Cannot package Sencha applicaiton for android native build on windows machine -
hi new sencha touch development.
trying run
sencha app package run config.json
to package application android native build either run on android emulator or deploy on android device. facing following problem.
following scenarios have tried no success
- setting android emulator in config file , running active emulator running.
get 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' 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 subdirectory or file ..\build\\\libs\ exists. subdirectory or file ..\build\\\assets\ 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: following error occurred while executing line: c:\program files\android\tools\ant\build.xml:110: java.lang.unsupportedclassversionerror: bad version number in .class file @ java.lang.classloader.defineclass1(native method) @ java.lang.classloader.defineclass(classloader.java:620) @ org.apache.tools.ant.antclassloader.defineclassfromdata(antclassloader.java:1124) @ org.apache.tools.ant.antclassloader.getclassfromstream(antclassloader.java:1295) @ org.apache.tools.ant.antclassloader.findclassincomponents(antclassloader.java:1351) @ org.apache.tools.ant.antclassloader.findclass(antclassloader.java:1311) @ org.apache.tools.ant.antclassloader.loadclass(antclassloader.java:1064) @ java.lang.classloader.loadclass(classloader.java:251) @ java.lang.classloader.loadclassinternal(classloader.java:319) @ java.lang.class.forname0(native method) @ java.lang.class.forname(class.java:242) @ org.apache.tools.ant.taskdefs.definer.adddefinition(definer.java:594) @ org.apache.tools.ant.taskdefs.definer.loadproperties(definer.java:423) @ org.apache.tools.ant.taskdefs.definer.execute(definer.java:279) @ org.apache.tools.ant.unknownelement.execute(unknownelement.java:291) @ sun.reflect.generatedmethodaccessor4.invoke(unknown source) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:25) @ java.lang.reflect.method.invoke(method.java:585) @ org.apache.tools.ant.dispatch.dispatchutils.execute(dispatchutils.java:106) @ org.apache.tools.ant.task.perform(task.java:348) @ org.apache.tools.ant.target.execute(target.java:390) @ org.apache.tools.ant.helper.projecthelper2.parse(projecthelper2.java:169) @ org.apache.tools.ant.taskdefs.importtask.importresource(importtask.java:225) @ org.apache.tools.ant.taskdefs.importtask.execute(importtask.java:163) @ org.apache.tools.ant.unknownelement.execute(unknownelement.java:291) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:39) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:25) @ java.lang.reflect.method.invoke(method.java:585) @ org.apache.tools.ant.dispatch.dispatchutils.execute(dispatchutils.java:106) @ org.apache.tools.ant.task.perform(task.java:348) @ org.apache.tools.ant.target.execute(target.java:390) @ org.apache.tools.ant.helper.projecthelper2.parse(projecthelper2.java:180) @ org.apache.tools.ant.projecthelper.configureproject(projecthelper.java:82) @ org.apache.tools.ant.main.runbuild(main.java:793) @ org.apache.tools.ant.main.startant(main.java:217) @ org.apache.tools.ant.launch.launcher.run(launcher.java:280) @ org.apache.tools.ant.launch.launcher.main(launcher.java:109) total time: 2 seconds rm failed /data/local/tmp/myapp.apk, no such file or directory length zd -- small file '../build/\myapp.apk' not 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"" not install application failed run packaged application copy operation failed src=../build/\\bin\myapp-debug.apk dst=../build/\\myapp.apk [err] stbuild exited non-zero code : 7 c:\project incubator\sencha-touch-2.1.1-gpl\myapp>
- setting android emulator in config file , running without emulator.
the cmd prompt shows sencha cmd tool version , noting happens not prompt returns, waited hours, in build folder 0 kb .apk file present.
- setting android device in config file , running without emulator. same case 2
have checked installed api version using
android.bat list targets
command, configured , run same api.
any on issue
following application/sdk used 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 , sass plugin ruby installed.
- jdk1.5.0_11 , java home set in environment variable.
- eclipse juno android sdk installed. certificate create android.
created skeleton project tried running in crome browser works fine.
created application configuration json file documentation suggested.
below file updated 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 same on sencha toch forum not published. let me know more information required comment. have been stuck issue last 2 weeks.
finally got solution. solution in posted question itself. due frustration did not observe simple problem.
the problem bad java path setting
since using eclipse build android application never felt need check class path, application built ide. sencha cmd build process uses command line arguments dependent on class path. so set classpath, path , java_home in environment variable of machine jdk 1.6 solved problem.
the first clue in line
c:/program files/android\tools\android" create project --target android-15 --name myapp --activity stactivity --path "../build//" --package org.amx.myapp
sencha cmd uses existing android sdk installation run commands on sdk/tools/android.bat file. above command creates android skeleton project, using setting in config .json file. since using android long time suspected installation of android sdk had gone rogue. installed newer installation of sdk google. running build.xml file in singleton project project produced same result.
java.lang.unsupportedclassversionerror: bad version number in .class file @ java.lang.classloader.defineclass1(native method)
some more search stack overflow, returned solution.
Comments
Post a Comment