I'm attempting to build an app using the Sencha Touch 2 builder tools. I have a basic app, I just want to test out creating an app so I can do it when I need to.
I've got the sencha tools, the android SDK etc
I've got to the point when you run
sencha package build <configfile.json>
in the command line. After several tries I've got to the point where it seems to accept the command, but it doesn't DO anything, doesn't create an app, doesn't display anything in command line, nothing.
I believe I'm missing something but can't think what.
This is my config file:
{
"applicationName":"Test_app",
"applicationId":"com.testing.test_App",
"versionString":"1.0",
"iconName:":"resources\icons\Icon.png",
"inputPath":"\",
"outputPath":"C:\Users\rc\Android Development\Completed Apps",
"configuration":"Debug",
"platform":"Android",
"deviceType":"Universal",
"certificatePath":"C:\Users\rc\Android Development\Keystore\Test App\my-release-key.keystore",
"certificateAlias":"Test_app",
"sdkPath":"C:\Program Files\Android\android-sdk",
"orientations": [
"portrait",
"landscapeLeft",
"landscapeRight",
"portraitUpsideDown"
]
}
I managed to solve this by using the following command instead:
sencha app build native
I will continue to look at the original way to understand it didn't work but this does work for now.
Your config file looks OK to me.
It can take a very long time for that command to respond - many minutes, on my machine here. It seems to buffer all its output until it completes. You can tell whether it really is doing something or not by watching the contents of the output path: you should see files and folders being created and destroyed.
Related
I am attempting to make some progress on my other issue here --> Kivy Launcher - AttributeError: ‘MyInputs’ object has no attribute ‘get_focus_next’
My intent now is to build Kivy Launcher (alternate suggestions on ways to prototype android python apps are welcome, but regardless I still would like to complete this). However, I've hit a new roadblock. Python-for-android is failing a long ways through the build, specifically it is failing as shown below.
The build command:
p4a apk --requirements=python2,kivy --permission WRITE_EXTERNAL_STORAGE --name="R Kivy Launcher" --package=com.kivy.rkivylauncher --version=0.0.1 --android_api 28 --bootstrap=pygame --launcher --minsdk 13
The error stuff (below that, is the system and configuration stuff I think might be important):
[INFO]: Building hostpython3 for armeabi-v7a
[INFO]: -> directory context /home/Me/.local/share/python-for-android/build/other_builds/hostpython3/desktop/hostpython3
[INFO]: -> directory context /home/Me/.local/share/python-for-android/build/other_builds/hostpython3/desktop/hostpython3/native-build
[INFO]: -> running configure
working: checking for dup3... yes raceback (most recent call last):
File "/usr/lib/python3.7/queue.py", line 179, in get
self.not_empty.wait(remaining)
File "/usr/lib/python3.7/threading.py", line 288, in wait
raise RuntimeError("cannot wait on un-acquired lock")
RuntimeError: cannot wait on un-acquired lock
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/p4a", line 10, in <module>
sys.exit(main())
File "/usr/lib/python3.7/site-packages/pythonforandroid/toolchain.py", line 1075, in main
ToolchainCL()
File "/usr/lib/python3.7/site-packages/pythonforandroid/toolchain.py", line 577, in __init__
getattr(self, args.subparser_name.replace('-', '_'))(args)
File "/usr/lib/python3.7/site-packages/pythonforandroid/toolchain.py", line 151, in wrapper_func
build_dist_from_args(ctx, dist, args)
File "/usr/lib/python3.7/site-packages/pythonforandroid/toolchain.py", line 200, in build_dist_from_args
build_recipes(build_order, python_modules, ctx)
File "/usr/lib/python3.7/site-packages/pythonforandroid/build.py", line 562, in build_recipes
recipe.build_arch(arch)
File "/usr/lib/python3.7/site-packages/pythonforandroid/python.py", line 417, in build_arch
sh.Command(join(recipe_build_dir, 'configure')))
File "/usr/lib/python3.7/site-packages/pythonforandroid/logger.py", line 178, in shprint
for line in output:
File "/usr/lib/python3.7/site-packages/sh.py", line 857, in next
chunk = self.process._pipe_queue.get(True, 0.001)
File "/usr/lib/python3.7/queue.py", line 182, in get
return item
File "/usr/lib/python3.7/threading.py", line 244, in __exit__
return self._lock.__exit__(*args)
RuntimeError: release unlocked lock
System:
Cygwin 3.0.3
Configuration:
- Python 3.7
- python-for-android 0.7.1
- buildozer 0.39
- sdk-tools-linux-4333796.zip
- android-ndk-r19b-linux-x86_64.zip (is
there an AMD specific variant? So far, Google says no...)
Happy to share more, just not really sure what else is important / potentially related. I have some totally wild suspicions (Cygwin and threading / lock incompatibilities?), but that's all I got.
Help?
Answering my own question (sort of) above: While I now understand there are a lot of set up requirements that are possible to allow direct use of p4a, in the end I realized the following in general:
My dedicated Linux box with 'Buildozer Android' turned out to be (eventually) the fastest / easiest to manage option for me. It just handles all the proper downloading and aligning of the components needed to make the build happen right. The new python3 version of Kivy Launcher installs, and starts with a list of apps available just like the one in the App Store, but alas it still crashes (and I'm still trying to figure out why, but I'm closer...)
On the path to this realization, I found:
Cygwin has some deep seated issues creating apk's - I'm still not certain whether the issues I experienced were directly due to the Cygwin environment, my Cygwin setup, my test App and the depreciated ListView stuff I had in it, my Computer Virus protection or a strong and unmanageable combination of the above.
I also struggled for a while trying to get MSYS2 and Mingw-w64 64 bit to build kivy stuff natively and for Android, but the whole Windows vs Unix pathname mixing, environment setup and a hundred other things proved too much of a distraction from my real goal : building an App to run natively on many platforms --> Mingw may still end up playing a role in the future but it's on the bookshelf for now.
I also tried Termux. And Eclipse. And looked into ways to make the new Android Studio work with Python. All might be possible (or none), and I really see the value in the idea of Eclipse and Android Studio for creating visual app front ends, so again those may find a future use as this project matures.
All in all, I want to thank many hundreds of people all over the internet - I had almost 80 tabs open at one time (plus multi-tab bookmarks saved!) to get to this point : With all the info available on Buildozer and why it works so well on a Linux machine, I ended where I probably should have started. My prototype kivy app runs on an Android phone, and (I hope soon) the Kivy Launcher will also. It seems the new relaunched Kivy Launcher fails in a way that makes me believe the 'ListView" depreciation is the reason it's crashing (it builds, starts to load the sample apps included, but then crashes and the logs are not so helpful as I'd hoped). If I can confirm and refactor it to fix this, I'll have something real to contribute back myself.
Stay tuned to the first link in my original post above if you care more about a new Kivy Launcher than you care about tools to build apk's - I'm hoping to add one more entry if I do indeed get Kivy Launcher working again with all the new kivy and python3 functionality I need. Now I just have to figure out RecycleView...
I'm trying to set up a local test rig for Appium before trying some cloud services. I've got the Appium.app running locally and have put together a very small test script in Ruby (using xpath). I'm trying to utilize arc (the Appium Ruby Console) to do some further scripting but am having trouble getting it launched. I've got everything installed (appium_lib, appium_console) and best I can tell it should be working. However, when I run the arc command at the terminal, I get the following error:
Failed to match sequence (ALL_SPACE (TABLE / TABLE_ARRAY / KEY_VALUE / COMMENT_LINE){0, } ALL_SPACE) at line 1 char 1.
`- Don't know what to do with "[caps]\n " at line 1 char 1.
Here are the contents of my appium.txt as of now.
[caps]
appium-version: '1.0',
platformName: 'Android',
platformVersion: '4.4',
deviceName: 'Nexus_5_API_22_Lollipop',
app: '/Users/justinr/Desktop/Development/TMSampleAndroid-master/app-debug.apk',
appPackage => 'com.marketlytics.calabashtest',
appActivity => 'com.marketlytics.calabashtest.MainActivity'
Thanks a ton in advance for any insight - please let me know if there are other useful files to see.
Running the arc setup android got this working for me (it stumps an appium.txt in the current directory). Still not sure what the problem with my original file was, though - I can't see any key differences.
I used to be able to run this without problem to get to the databases folder of my Android App:
window.resolveLocalFileSystemURI('file:///data/data/{package name}/databases',
function (entry) {
alert(entry.fullPath);
}, rlfsOnErrors);
However, the statement returns error when I am using file-transfer plugin v0.4.2. When I switched back to file-transfer plugin v0.3.3, there is no problem. When I am using v0.4.2, I can only gain access to file:///data/media/xxxx directory and not file:///data/data/xxxx.
Anyone has any idea how I can workaround this ? Currently, I am sticking to v0.3.3, but I am sure there is some way to workaround this ?
Thanks.
I'm scratching my head on this one.
My add-on installs but does not seem to function.
I have a working add-on I built for Firefox(web) that geolocates, gets domain/path/etc/, user-agent, ports the info to the content script, yada yada, etc etc, but I couldn't seem to get it to do more than install on the nightly Fennec build.
I understand some modules aren't available on mobile yet, which is not a big deal, at this point I am literally just trying to get an alert box to pop-up.
Just for the hell of it here are the basic files for the alert box:
lib/main.js
var data = require("sdk/self").data;
var pageMod = require("sdk/page-mod");
exports.main = function() {
pageMod.PageMod({
include: "*",
contentScriptWhen: 'ready',
contentScriptFile: [data.url("test.js") ],
attachTo: ["top"]
});
};
data/test.js
window.alert("hello");
alert("you");
My thoughts are this may be a version conflict, but my fix didn't seem to make a difference.
I have installed the nightly build of firefox which today is (29.0a1)
I have installed the Addon-sdk-1.15 (current)
When I package my addon
cfx xpi --force-mobile
the produced Install.rdf reads max-version(22.0a1).
This appears to be my problem, so I have adjusted the max-version to (29.0a1) in the constructor for the install.rdf located in /addon-sdk-1.15/app-extension/install.rdf, so when I package again the max-version will match my nightly build.
Is this the correct method of doing this?
I install the xpi, by
adb push my-addon.xpi /mnt/sdcard/
Then open Firefox Mobile and type this into the address bar:
file:///mnt/sdcard/my-addon.xpi
It installs correctly, but again, no functionality.
Does anyone have any useful input?
Thank you in advance.
I am trying to submit a update to the google play store for my sencha touch 2 app.
the following is my packager.json file.
{
"applicationName":"DBS",
"applicationId":"com.keshav.dbs",
"versionCode":"2",
"versionString":"1.0.1",
"iconName":"ic_launcher.png",
"inputPath":"./build/package/Android",
"outputPath":"./build/native/Android",
"configuration":"Release",
"platform":"Android",
"deviceType":"Universal",
"certificatePath":"/Developer/Android-Keystore/myAndroidKeyStore",
"certificateAlias":"myandroidkey",
"certificatePassword":"<password>",
"sdkPath":"/Developer/sdks/android-sdk-macosx",
"androidAPILevel":"16",
"orientations": [
"portrait"
]
}
I run the following command
sencha package run packager.json
this creates the apk file however when i try to upload the new apk i get a message saying the versonCode 1 is already in use.
The instruction of packaging on Senchas website dont include the "versionCode" property I added that my self
Does anyone know how to change the version code for sencha app?
I was able to edit platforms/cordova/android/AndroidManifest.xml and update the android:versionCode, then run sencha app build native
It built the new APK (signed, based on my config) and it was accepted by the Google Play store.
Much easier than un-packaging and repackaging.
well here it is ...
After looking around the internet i found this approach works....
After Sencah creates the package use apktool to un-package the apk then edit the AndroidManifest.xml and package it up again with apktool.
Note when you re-package the app tit will be unsigned so you will have to sign it again for it install on peoples devices