-
17 Nov 2011 7:30 AM #1
Unanswered: Packaging an application for Android using Sencha Touch Native Packaging
Unanswered: Packaging an application for Android using Sencha Touch Native Packaging
I'm having some problems packaging an app for Android. When I try to package for Android I get the following error:
When I run the command 'android list targets' I get this:Code:sencha package androidTemplate.json Error: Target id is not valid. Use 'android list targets' to get the target ids. Buildfile: build.xml does not exist! Build failed
So I guess the targets are in place? Is there a way to specify the target? Or does Sencha native packaging target another SDK that I have not downloaded yet?Code:Available Android targets:---------- id: 1 or "android-10" Name: Android 2.3.3 Type: Platform API level: 10 Revision: 2 Skins: HVGA, QVGA, WQVGA400, WQVGA432, WVGA800 (default), WVGA854 ABIs : armeabi ---------- id: 2 or "Google Inc.:Google APIs:10" Name: Google APIs Type: Add-On Vendor: Google Inc. Revision: 2 Description: Android + Google APIs Based on Android 2.3.3 (API level 10) Libraries: * com.android.future.usb.accessory (usb.jar) API for USB Accessories * com.google.android.maps (maps.jar) API for Google Maps Skins: WVGA854, WQVGA400, HVGA, WQVGA432, WVGA800 (default), QVGA ABIs : armeabi ---------- id: 3 or "android-14" Name: Android 4.0 Type: Platform API level: 14 Revision: 1 Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800 ABIs : armeabi-v7a ---------- id: 4 or "Google Inc.:Google APIs:14" Name: Google APIs Type: Add-On Vendor: Google Inc. Revision: 1 Description: Android + Google APIs Based on Android 4.0 (API level 14) Libraries: * com.android.future.usb.accessory (usb.jar) API for USB Accessories * com.google.android.maps (maps.jar) API for Google Maps Skins: WVGA854, WQVGA400, WSVGA, WXGA720, HVGA, WQVGA432, WVGA800 (default), QVGA, WXGA800 ABIs : armeabi-v7a
This is my template.json:
Any thoughts?Code:{"applicationName": "STestApp", "applicationId": "com.flix.testapp", "outputPath": "~/build", "iconName": "/Applications/XAMPP/xamppfiles/htdocs/logo.png", "versionString": "0.1", "webAppPath": "/Applications/XAMPP/xamppfiles/htdocs/testapp", "configuration": "Debug", "platform": "Android", "certificatePath": "/Users/flix/flix-release.keystore", "certificateAlias": "flix", "sdkPath": "/Developer/android-sdk-mac_x86", "orientations": [ "portrait", "landscapeLeft", "landscapeRight", "portraitUpsideDown" ], "deviceType": "Universal" }
-
23 Nov 2011 8:12 AM #2
Just an update (and a kick)
This outputs a .app folder! It seems that building an Android App is broken in the SDK tools. Was anybody able to create a natively packaged app for Android with the Sencha SDK? I tried switching configuration to Release and using Android instead of AndroidEmulator. If I use Android building still fails with the error from my first post (Error: Target id is not valid. Use 'android list targets' to get the target ids. Buildfile: build.xml does not exist!. Build failed). Removing the certificate stuff didn't help.Code:{"applicationName": "STestApp", "applicationId": "com.flix.testapp", "iconName": "logo.png", "outputPath": "/Applications/XAMPP/xamppfiles/htdocs/Builds/", "versionString": "1.0", "webAppPath": "/Applications/XAMPP/xamppfiles/htdocs/testapp/", "configuration": "Debug", "platform": "AndroidEmulator", "deviceType": "Universal", "certificatePath":"~/flix-release.keystore", "certificateAlias":"felixmann", "sdkPath": "/Developer/android-sdk-mac_x86", "orientations": [ "portrait", "landscapeLeft", "landscapeRight", "portraitUpsideDown" ] }
If someone has some spare time to experiment, please let me know your findings. iPhone packaging works with the following config:
Code:{"applicationName":"STestApp", "applicationId":"com.flix.testapp", "outputPath":"/Applications/XAMPP/xamppfiles/htdocs/Builds/", "iconName":"/Applications/XAMPP/xamppfiles/htdocs/logo.png", "versionString":"1.0", "webAppPath":"/Applications/XAMPP/xamppfiles/htdocs/testapp/", "configuration":"Debug", "platform":"iOSSimulator", "deviceType":"Universal", "orientations": ["portrait", "landscapeLeft", "landscapeRight", "portraitUpsideDown" ] }
-
24 Nov 2011 3:06 AM #3
Okay, apparently Sencha Engineers only target Android 2.2 in the Developer Preview. I only had 2.3.3 and 4.0 installed, so I got this (not so helpful) error. The cool (or not so cool) thing is that the build scripts now target API Level 14 (Android 4.0)!. There is clearly something wrong with the Android Building. I would like to suggest using variables in the json config files to choose an Android version/API level to build with.
OR... I missed something complete obvious and am retarded (also probable). I would (again) like to ask someone to test building for android and post their findings. This is my output:
Code:Felixs-MacBook:htdocs flix$ sencha package androidTemplate.json Error: Project folder '/Users/flix/builds' is not empty. Please consider using 'android update' instead. Created directory /Users/flix/builds/src/com/flix/stest Added file /Users/flix/builds/src/com/flix/stest/NKBuildActivity.java Created directory /Users/flix/builds/res Created directory /Users/flix/builds/bin Created directory /Users/flix/builds/libs Created directory /Users/flix/builds/res/values Added file /Users/flix/builds/res/values/strings.xml Created directory /Users/flix/builds/res/layout Added file /Users/flix/builds/res/layout/main.xml Created directory /Users/flix/builds/res/drawable-hdpi Created directory /Users/flix/builds/res/drawable-mdpi Created directory /Users/flix/builds/res/drawable-ldpi Added file /Users/flix/builds/AndroidManifest.xml Added file /Users/flix/builds/build.xml Added file /Users/flix/builds/proguard.cfg Buildfile: /Users/flix/builds/build.xml -set-mode-check: -set-debug-files: -set-debug-mode: -debug-obfuscation-check: -setup: [echo] Gathering info for stest... [setup] Android SDK Tools Revision 15 [setup] Project Target: Android 4.0 [setup] API level: 14 [setup] [setup] ------------------ [setup] Resolving library dependencies: [setup] No library dependencies. [setup] [setup] ------------------ [setup] [setup] WARNING: Attribute minSdkVersion in AndroidManifest.xml (6) is lower than the project target API level (14) -build-setup: [echo] Creating output directories if needed... [mkdir] Created dir: /Users/flix/builds/bin/res [mkdir] Created dir: /Users/flix/builds/gen [mkdir] Created dir: /Users/flix/builds/bin/classes -pre-build: -code-gen: [echo] ---------- [echo] Handling aidl files... [aidl] No aidl files to compile. [echo] ---------- [echo] Handling RenderScript files... [renderscript] No renderscript files to compile. [echo] ---------- [echo] Handling Resources... [aapt] Generating resource IDs... -pre-compile: -compile: [javac] /Developer/android-sdk-mac_x86/tools/ant/build.xml:600: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds [javac] Compiling 2 source files to /Users/flix/builds/bin/classes -post-compile: -obfuscate: -dex: [dex] Converting compiled files and external libraries into /Users/flix/builds/bin/classes.dex... -crunch: [crunch] Crunching PNG Files in source dir: /Users/flix/builds/res [crunch] To destination dir: /Users/flix/builds/bin/res [crunch] Processing image to cache: /Users/flix/builds/res/drawable-hdpi/ic_launcher.png => /Users/flix/builds/bin/res/drawable-hdpi/ic_launcher.png [crunch] (processed image to cache entry /Users/flix/builds/bin/res/drawable-hdpi/ic_launcher.png: 0% size of source) [crunch] Processing image to cache: /Users/flix/builds/res/drawable-hdpi/icon.png => /Users/flix/builds/bin/res/drawable-hdpi/icon.png [crunch] (processed image to cache entry /Users/flix/builds/bin/res/drawable-hdpi/icon.png: 59% size of source) [crunch] Processing image to cache: /Users/flix/builds/res/drawable-ldpi/ic_launcher.png => /Users/flix/builds/bin/res/drawable-ldpi/ic_launcher.png [crunch] (processed image to cache entry /Users/flix/builds/bin/res/drawable-ldpi/ic_launcher.png: 0% size of source) [crunch] Processing image to cache: /Users/flix/builds/res/drawable-ldpi/icon.png => /Users/flix/builds/bin/res/drawable-ldpi/icon.png [crunch] (processed image to cache entry /Users/flix/builds/bin/res/drawable-ldpi/icon.png: 59% size of source) [crunch] Processing image to cache: /Users/flix/builds/res/drawable-mdpi/ic_launcher.png => /Users/flix/builds/bin/res/drawable-mdpi/ic_launcher.png [crunch] (processed image to cache entry /Users/flix/builds/bin/res/drawable-mdpi/ic_launcher.png: 0% size of source) [crunch] Processing image to cache: /Users/flix/builds/res/drawable-mdpi/icon.png => /Users/flix/builds/bin/res/drawable-mdpi/icon.png [crunch] (processed image to cache entry /Users/flix/builds/bin/res/drawable-mdpi/icon.png: 59% size of source) [crunch] Crunched 6 PNG files to update cache -package-resources: [aapt] Creating full resource package... [aapt] (skipping hidden file '/Users/flix/builds/assets/.DS_Store') -package: [apkbuilder] Creating stest-debug-unaligned.apk and signing it with a debug key... -do-debug: [zipalign] Running zip align on final apk... [echo] Debug Package: /Users/flix/builds/bin/stest-debug.apk debug: [propertyfile] Creating new property file: /Users/flix/builds/bin/build.prop [propertyfile] Updating property file: /Users/flix/builds/bin/build.prop [propertyfile] Updating property file: /Users/flix/builds/bin/build.prop [propertyfile] Updating property file: /Users/flix/builds/bin/build.prop BUILD SUCCESSFUL Total time: 9 seconds
-
25 Jan 2012 3:16 AM #4
Which Sencha SDK version are you using? the SDK 1.2.3? or the SDK 2.0.
After a quick research, Sencha SDK 2.0 is still a preview release and is only functional for packaging iOS apps. I hope Sencha SDK 2.0 will allow packaging to Android as well in the final release.
As for Sencha SDK 1.2.3, i couldn't find any documentation where it states any ability to package to native app. so i am not certain SDK 1.2.3 is capable of packaging to native app for either iOS nor Android. i hope i'm wrong on this though.
-
25 Jan 2012 3:26 PM #5
This has been my experience as well. Downloaded Sencha SDK 1.2.3 for Windows, but it doesn't seem to do anything when I try to package my app. I even tried some invalid arguments and got no error message in response, basically a noop. I'm left guessing that packaging is supported in SDK 2.0, which is currently available only for a Mac.
-
27 Feb 2012 2:58 PM #6Sencha - Management Team
- Join Date
- Aug 2008
- Location
- Palo Alto, CA
- Posts
- 372
- Vote Rating
- 1
- Answers
- 6
Can you try using the latest packager: http://www.sencha.com/blog/sencha-to...ive-packaging/
Now supports ios packaging on windows.
-
28 Feb 2012 1:24 PM #7
API Level 7 seems to be hardcoded. I eventually managed to get the Android build working on Mac.
There is also a "certificatePassword" field missing in the documentation and build notes if you have a password with your keystore.
I'm also surprised you got webapp path to work, mine forced me to use inputpath.
Paul
-
19 Mar 2012 4:18 AM #8
Native API Packaging for Android.... BuIld sucessful is enough or something else.
Native API Packaging for Android.... BuIld sucessful is enough or something else.
Please anybody i am getting the error like this. i have tried somany time i am getting the same.....
[crunch] Crunched 6 PNG files to update cache
[crunch] libpng error: Read Error
[crunch] libpng error: Read Error
[crunch] libpng error: Read Error
BUILD SUCCESSFUL
Total time: 5 seconds
""C:/Program Files/Android/android-sdk\tools\android" create project --target an
droid-15 --name nativeAPI --activity STActivity --path wis/\ --package com.cando
rapps"
Can not open source file
Can not open source file
Can not open source file
Thanks in advance i am a new programmer to sencha touch and android... help...me
And the inputPath refers to the android projectpath or the index.html path ....
-
30 Mar 2012 9:02 AM #9
I am receiving the same type of errors. Did you get a solution? My build works on the web, but not in Android. Just the load indicator is showing.
-
4 Dec 2012 7:46 PM #10
Same here.
Same here.
I have the same issue: My build works on the web, but not in Android. Just the load indicator is showing.
I am using Sencha SDK Tools Beta3
No error displayed on device - not sure how to debug it.


Reply With Quote