title: Cannot package Sencha applicaiton for android native build on windows machine
body: <p>Hi I am new to sencha touch development.</p>
  
  <p>trying to run </p>
  
  <blockquote>
    <p>sencha app package run config.json</p>
  </blockquote>
  
  <p>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.</p>
  
  <p>Following are scenarios I have tried with no success</p>
  
  <ol>
  <li>Setting android emulator in config file and running with the an active emulator running.</li>
  </ol>
  
  <p><em><strong>Get the following error.</em></strong></p>
  
  <pre><code>C:\project incubator\sencha-touch-2.1.1-gpl\MyApp&gt;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&gt;
  </code></pre>
  
  <ol>
  <li>Setting android emulator in config file and running without an emulator.</li>
  </ol>
  
  <p><strong>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.</strong></p>
  
  <ol>
  <li>Setting android device in config file and running without an emulator.
  <strong>Same as case 2</strong></li>
  </ol>
  
  <p>Have checked the installed api version using </p>
  
  <blockquote>
    <p>android.bat list targets</p>
  </blockquote>
  
  <p>command, configured and run the same API.</p>
  
  <p><strong>Any help will on this issue</strong> </p>
  
  <p>Following are the application/sdk used for sencha touch development on windows XP SP3 machine.</p>
  
  <ol>
  <li>Sencha Cmd v3.1.2.342</li>
  <li>sencha-touch-2.1.1-gpl / sencha-touch-2.2.1-gpl</li>
  <li>Ruby installed </li>
  <li>Compass and SASS plugin for ruby installed.</li>
  <li>jdk1.5.0_11 and java home set in environment variable.</li>
  <li>Eclipse Juno with android SDK installed. certificate create for android.</li>
  </ol>
  
  <p>Created a skeleton project an tried running in Crome browser works fine.</p>
  
  <p>Created a application configuration json file as documentation suggested.</p>
  
  <p>Below is the file updated for my application.</p>
  
  <pre><code>{
      "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"
      ]
  }
  </code></pre>
  
  <p><strong>Please help.</strong> 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.</p>