Hi I am new to sencha touch development.
trying to run
sencha app package run config.json
to package my application for a android native build to either run on android emulator or to deploy on my android device. But facing the following problem.
Following are scenarios I have tried with no success
- Setting android emulator in config file and running with the an active emulator running.
Get the following error.
C:\project incubator\sencha-touch-2.1.1-gpl\MyApp>sencha app package run config.json
Sencha Cmd v3.1.2.342
[ERR]
Error: Project folder 'C:\project incubator\sencha-touch-2.1.1-gpl\build' is not empty. Please consider using 'android.bat update' instead.
Created directory C:\project incubator\sencha-touch-2.1.1-gpl\build\src\org\amx\MyApp
Added file C:\project incubator\sencha-touch-2.1.1-gpl\build\src\org\amx\MyApp\STActivity.java
Created directory C:\project incubator\sencha-touch-2.1.1-gpl\build\res
Created directory C:\project incubator\sencha-touch-2.1.1-gpl\build\bin
Created directory C:\project incubator\sencha-touch-2.1.1-gpl\build\libs
Created directory C:\project incubator\sencha-touch-2.1.1-gpl\build\res\values
Added file C:\project incubator\sencha-touch-2.1.1-gpl\build\res\values\strings.xml
Created directory C:\project incubator\sencha-touch-2.1.1-gpl\build\res\layout
Added file C:\project incubator\sencha-touch-2.1.1-gpl\build\res\layout\main.xml
Created directory C:\project incubator\sencha-touch-2.1.1-gpl\build\res\drawable-hdpi
Created directory C:\project incubator\sencha-touch-2.1.1-gpl\build\res\drawable-mdpi
Created directory C:\project incubator\sencha-touch-2.1.1-gpl\build\res\drawable-ldpi
Added file C:\project incubator\sencha-touch-2.1.1-gpl\build\AndroidManifest.xml
Added file C:\project incubator\sencha-touch-2.1.1-gpl\build\build.xml
Added file C:\project incubator\sencha-touch-2.1.1-gpl\build\proguard-project.txt
A subdirectory or file ..\build\\\libs\ already exists.
A subdirectory or file ..\build\\\assets\ already exists.
Buildfile: C:\project incubator\sencha-touch-2.1.1-gpl\build\build.xml
BUILD FAILED
C:\project incubator\sencha-touch-2.1.1-gpl\build\build.xml:90: The following error occurred while executing this line:
C:\Program Files\Android\tools\ant\build.xml:110: java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at org.apache.tools.ant.AntClassLoader.defineClassFromData(AntClassLoader.java:1124)
at org.apache.tools.ant.AntClassLoader.getClassFromStream(AntClassLoader.java:1295)
at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1351)
at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1311)
at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:1064)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:242)
at org.apache.tools.ant.taskdefs.Definer.addDefinition(Definer.java:594)
at org.apache.tools.ant.taskdefs.Definer.loadProperties(Definer.java:423)
at org.apache.tools.ant.taskdefs.Definer.execute(Definer.java:279)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:169)
at org.apache.tools.ant.taskdefs.ImportTask.importResource(ImportTask.java:225)
at org.apache.tools.ant.taskdefs.ImportTask.execute(ImportTask.java:163)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:180)
at org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:82)
at org.apache.tools.ant.Main.runBuild(Main.java:793)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Total time: 2 seconds
rm failed for /data/local/tmp/MyApp.apk, No such file or directory
Length is zd -- too small
file '../build/\MyApp.apk' is not a valid zip file
""C:/Program Files/Android\tools\android" create project --target android-15 --name MyApp --activity STActivity --path "../build/\/" --package org.amx.MyApp"
Can not open source file
""C:/Program Files/Android\platform-tools\adb" install -r "../build/\MyApp.apk""
Could not install application
Failed to run packaged application
Copy operation failed src=../build/\\bin\MyApp-debug.apk dst=../build/\\MyApp.apk
[ERR] stbuild exited with non-zero code : 7
C:\project incubator\sencha-touch-2.1.1-gpl\MyApp>
- Setting android emulator in config file and running without an emulator.
The CMD prompt only shows sencha cmd tool version and noting happens not even prompt returns, waited for hours, in the build folder a 0 kb .apk file is present.
- Setting android device in config file and running without an emulator. Same as case 2
Have checked the installed api version using
android.bat list targets
command, configured and run the same API.
Any help will on this issue
Following are the application/sdk used for sencha touch development on windows XP SP3 machine.
- Sencha Cmd v3.1.2.342
- sencha-touch-2.1.1-gpl / sencha-touch-2.2.1-gpl
- Ruby installed
- Compass and SASS plugin for ruby installed.
- jdk1.5.0_11 and java home set in environment variable.
- Eclipse Juno with android SDK installed. certificate create for android.
Created a skeleton project an tried running in Crome browser works fine.
Created a application configuration json file as documentation suggested.
Below is the file updated for my application.
{
"applicationName":"MyApp",
"applicationId":"org.amx.MyApp",
"bundleSeedId":"KPXFEPZ6EF",
"versionString":"1.0",
"versionCode":"1",
"icon": {
"36":"resources/icons/Icon.png",
"48":"resources/icons/Icon.png",
"72":"resources/icons/Icon.png"
},
"inputPath":"./",
"outputPath":"../build/",
"configuration":"Debug",
"platform":"Android",
"deviceType":"Universal",
"certificatePath":"../../my-release-key.keystore",
"certificateAlias":"",
"certificatePassword":"abc123",
"provisionProfile":"",
"URLScheme":"",
"notificationConfiguration":"",
"sdkPath":"C:/Program Files/Android/android-sdk",
"androidAPILevel":"16",
"permissions":[
"INTERNET",
"ACCESS_NETWORK_STATE",
"CAMERA",
"VIBRATE",
"ACCESS_FINE_LOCATION",
"ACCESS_COARSE_LOCATION",
"CALL_PHONE"
],
"orientations": [
"portrait",
"landscapeLeft",
"landscapeRight",
"portraitUpsideDown"
]
}
Please help. Tried posting the same on sencha toch forum was not even published. Let me know any more information required will comment. Have been stuck with this issue from last 2 weeks.