PDA

View Full Version : No APK file gets created when trying to package Touch app for Android



parky128
27 Feb 2012, 4:45 AM
Hi

I am having a go at packaging up my Touch application into native Android using the 2.0 beta version of the SDK tools.

I have created a config file and when I run the package command from my command line tool, I don't see any output in the console to suggest an apk file has generated and no file appears in the target directory specified in the config file either. I dont get any errors either, the console just gives me a new command line.

I am at a dead end now, has anyone out there successfully packaged up an apk file following the Touch docs here http://docs.sencha.com/touch/2-0/#!/guide/native_android

chapkin
27 Feb 2012, 11:54 AM
the same problem on windows 7 64 bit.

I traced the problem to the following: there is a console program stbuild.exe that installs as part of sencha SDK and that is called when you do sencha package config.json

the thing is : when you change the platform name in the config from IOSSImulator to either Android or AndroidEmulator, stbuild stops analyzing the file and does not do anything - even if all paths in the config are plain wrong.

for IOS it at least prints messages like "build/ directory does not exist - cannot copy files" and so on.

so this may well be a problem with the current version of stbuild.exe in Sencha Touch SDK

parky128
27 Feb 2012, 1:24 PM
I am also running windows 7 64 bit, sounding more and more like a bug in the sdk tools now!?

sebastianwoinar
28 Feb 2012, 12:44 AM
Same issue with SenchaSDKTools 2.0.0 beta for MAC OSx Lion.

platform: IOSSImulator works,

AndroidEmulator does not create or tell me anything.

parky128
28 Feb 2012, 3:56 AM
Ok, I have now managed to get the packager running on an Windows XP machine and am now seeing debug in the console.

The build keeps failing for me as follows:



C:\AndroidApps\BuildTemplates>sencha package run pptouchTemplate.json
Created directory C:\AndroidApps\BuildTemplates\build\src\sbs\pinpointers\pptouc
h
Added file C:\AndroidApps\BuildTemplates\build\src\sbs\pinpointers\pptouch\STAct
ivity.java
Created directory C:\AndroidApps\BuildTemplates\build\bin
Created directory C:\AndroidApps\BuildTemplates\build\libs
Created directory C:\AndroidApps\BuildTemplates\build\res\values
Added file C:\AndroidApps\BuildTemplates\build\res\values\strings.xml
Created directory C:\AndroidApps\BuildTemplates\build\res\layout
Added file C:\AndroidApps\BuildTemplates\build\res\layout\main.xml
Added file C:\AndroidApps\BuildTemplates\build\AndroidManifest.xml
Added file C:\AndroidApps\BuildTemplates\build\build.xml
Buildfile: C:\AndroidApps\BuildTemplates\build\build.xml
[setup] Project Target: Android 2.1
[setup] API level: 7

-compile-tested-if-test:

-dirs:
[echo] Creating output directories if needed...
[mkdir] Created dir: C:\AndroidApps\BuildTemplates\build\gen
[mkdir] Created dir: C:\AndroidApps\BuildTemplates\build\bin\classes

-resource-src:
[echo] Generating R.java / Manifest.java from the resources...
[exec] libpng error: Read Error
[exec] ERROR: Failure processing PNG image C:\AndroidApps\BuildTemplates\bu
ild\res\drawable-hdpi\icon.png
[exec] libpng error: Read Error
[exec] ERROR: Failure processing PNG image C:\AndroidApps\BuildTemplates\bu
ild\res\drawable-ldpi\icon.png
[exec] libpng error: Read Error
[exec] ERROR: Failure processing PNG image C:\AndroidApps\BuildTemplates\bu
ild\res\drawable-mdpi\icon.png
[exec] C:\AndroidApps\BuildTemplates\build\AndroidManifest.xml:10: error: E
rror: No resource found that matches the given name (at 'icon' with value '@draw
able/icon').
""C:/android-sdk-windows/tools/android" create project --target android-7 --name
PinpointersTouch --activity STActivity --path "build//" --package sbs.pinpointe
rs.pptouch"
Could not install application
Failed to run packaged application


It would appear its having trouble with the icon image I have specified in the config file. When I look at the copies of the icon in the res folder they are just blank (no images at all).

I have made sure my icon conforms to the Android developers guide too.

Any thoughts?

parky128
28 Feb 2012, 8:18 AM
I have even tried an image from an Android launcher icon sample pack from their developer site but still I get the same build errors as above.

voloshyn
29 Feb 2012, 12:29 PM
please post your json configuration files or send them to alex.voloshyn@sencha.com, I will try to fix those issues as soon as possible. Also don't hesitate to contact me directly through email so we could figure out why it's not working for you and fix it. thanks!

Nares
18 Jul 2012, 8:49 AM
Have same issue ie not able to create a apk file.

Please note my android.json

{
"applicationName":"AthenaMobile",
"applicationId":"com.mycompany.AthenaMobile",
"bundleSeedId":"KPXFEPZ6EF",
"versionString":"1.0",
"versionCode":"1",
"iconName": "C:/Icon.png",
"inputPath":"C:/apache-tomcat-7.0.23/webapps/AthenaMobile",
"outputPath":"C:/release",
"configuration":"Release",
"platform":"Android",
"deviceType":"Universal",
"certificatePath":"C:/athenamobile-key.keystore",
"certificateAlias":"athenamobile",
"sdkPath":"C:/android-sdk-windows",
"androidAPILevel":"15",
"orientations": [
"portrait",
"landscapeLeft",
"landscapeRight",
"portraitUpsideDown"
]
}



While build (sencha package run android.json), I get following errors:
Total time: 0 seconds
can't find 'C:/release\AthenaMobile.apk' to install
Copy operation failed src=C:/apache-tomcat-7.0.23/webapps/AthenaMobile\\C:/Icon.
png dst=C:/release\\res\drawable-ldpi\icon.png




Please help

efreetant
23 Jan 2013, 2:20 PM
Is this been solved. Still having the same problem here.

voloshyn
23 Jan 2013, 2:36 PM
this config is very outdated, install latest Sencha Command, then run sencha generate app and look on packager.json. Anyway, it is best to work though Sencha Command using "sencha app build native" rather then using packager (stbuild) directly.

efreetant
23 Jan 2013, 3:55 PM
Thank you very much for your quick reply. I am using the lastest sencha command I believe (downloaded yesterday). And i have tried both commands 'sencha app build native' and 'sencha package build packager.json', both no success and no error.

Here is the my packager.json file
{
"applicationName":"testapp",
"applicationId":"testapp",
"versionString":"1.0",
"iconName":"resources/icons/Icon~ipad.png",
"inputPath":"D:/Ming/websites/widgets/sencha-touch/testapp",
"outputPath":"C:/Users/Ming/build",
"configuration":"Debug",
"platform":"AndroidEmulator",
"deviceType":"Universal",
"certificatePath":"debug.keystore",
"certificateAlias":"androiddebugkey",
"certificatePassword":"testapppass",
"sdkPath":"C:/Users/Ming/android-sdks",
"androidAPILevel":"15",
"orientations": [
"portrait",
"landscapeLeft",
"landscapeRight",
"portraitUpsideDown"
]
}

this file is inside the application folder, the debug.keystore file is in the same folder too.
Thanks again for your help.

voloshyn
23 Jan 2013, 4:00 PM
this is outdated config, generate new app and see packager,json file, it may happen when your app was generated long time ago and upgrade process does not upgrade packager.json, also what version of the tools you have including build number, check the name of the downloaded file of sencha command, it's all in filename

efreetant
23 Jan 2013, 4:21 PM
I am using SenchaSDKTools-2.0.0-beta3-windows and below is the json file inside the application I just generated using the sencha app create cmd

{
"applicationName":"My Application",
"applicationId":"com.mycompany.myAppID",
"versionString":"1.0",
"iconName":"resources/icons/Icon~ipad.png",
"inputPath":"build/native",
"outputPath":"build/",
"configuration":"Debug",
"platform":"iOSSimulator",
"deviceType":"Universal",
"certificatePath":"/path/to/certificate.file",
"certificateAlias":"",
"sdkPath":"/path/to/android-sdk",
"androidAPILevel":"15",
"orientations": [
"portrait",
"landscapeLeft",
"landscapeRight",
"portraitUpsideDown"
]
}

looks the same to me....

voloshyn
23 Jan 2013, 4:28 PM
SDK tools was replaced for Sencha Command, here is the link to download: http://www.sencha.com/products/sencha-cmd/download