首页新闻找找看学习计划

sencha touch 打包时报错

1
悬赏园豆:180 [已解决问题] 解决于 2013-12-17 23:34

    各位好!最近刚接触sencha touch,我在命令行用“sencha app build native”命令生成android apk 文件老师报错,这个问题已经困扰我一周多了,好烦恼,求大伙帮帮忙,感激不尽!!

     我用win7,安装了jdk1.7,ruby,sdk,sencha CMD,ant。环境变量也按照网上教程设置了,每个软件都正常运行。

运行结果如下(其中创建文件那块出现几处乱码,求大神分析):

Sencha Cmd v4.0.1.45
[INF]
[INF] init-plugin:
[INF]
[INF] cmd-root-plugin.init-properties:
[INF]
[INF] init-properties:
[INF]
[INF] init-sencha-command:
[INF]
[INF] init:
[INF]
[INF] app-build-impl:
[INF]
[INF] -before-init-local:
[INF]
[INF] -init-local:
[INF]
[INF] -after-init-local:
[INF]
[INF] init-local:
[INF]
[INF] find-cmd-in-path:
[INF]
[INF] find-cmd-in-environment:
[INF]
[INF] find-cmd-in-shell:
[INF]
[INF] init-cmd:
[INF] [echo] Using Sencha Cmd from D:\senchacmd\Sencha\Cmd\4.0.1.45 for D:\wamp\www\myapp\build.xml
[INF]
[INF] -before-init:
[INF]
[INF] -init:
[INF] Initializing Sencha Cmd ant environment
[INF] Adding antlib taskdef for com/sencha/command/compass/ant/antlib.xml
[INF]
[INF] -after-init:
[INF]
[INF] -before-init-defaults:
[INF]
[INF] -init-defaults:
[INF]
[INF] -after-init-defaults:
[INF]
[INF] -init-compiler:
[INF]
[INF] init:
[INF]
[INF] -before-build:
[INF]
[INF] refresh:
[INF]
[INF] -before-refresh:
[INF]
[INF] -init:
[INF]
[INF] -init-compiler:
[INF]
[INF] -detect-app-build-properties:
[INF] Loading app json manifest...
[INF] Loading classpath entry D:\wamp\www\myapp\touch\src
[INF] Loading classpath entry D:\wamp\www\myapp\app.js
[INF] Loading classpath entry D:\wamp\www\myapp\app
[INF] Loading classpath entry D:\wamp\www\myapp\build\temp\native\myapp\sencha-compiler\app
[INF] Loading classpath entry D:\wamp\www\myapp\build\temp\native\myapp\sencha-compiler\app
[INF] Concatenating output to file D:\wamp\www\myapp/build/temp/native/myapp/sencha-compiler/cmd-packages.js
[INF] Adding external reference : @full-page => @overrides
[INF] Loading classpath entry D:\wamp\www\myapp\build\temp\native\myapp\sencha-compiler\cmd-packages.js
[INF] Adding external reference : Ext.util.Observable => D:\wamp\www\myapp/build/temp/native/myapp/sencha-compiler/cmd-packages.js
[INF]
[INF] -refresh-app:
[INF] Appending concatenated output to file D:\wamp\www\myapp/bootstrap.js
[INF] Appending concatenated output to file D:\wamp\www\myapp/bootstrap.js
[INF] Appending concatenated output to file D:\wamp\www\myapp/bootstrap.js
[INF] Appending concatenated output to file D:\wamp\www\myapp/bootstrap.js
[INF] Appending concatenated output to file D:\wamp\www\myapp/bootstrap.js
[INF] Appending content to D:\wamp\www\myapp/bootstrap.json
[INF]
[INF] -refresh:
[INF]
[INF] -after-refresh:
[INF]
[INF] resolve:
[INF]
[INF] js:
[INF]
[INF] -before-js:
[INF]
[INF] -init:
[INF]
[INF] -init-compiler:
[INF]
[INF] -detect-app-build-properties:
[INF]
[INF] -compile-js:
[INF] Compressing data with YuiJavascriptCompressor
[INF] Concatenating output to file D:\wamp\www\myapp/build/native/myapp/app.js
[INF]
[INF] -js:
[INF]
[INF] -after-js:
[INF]
[INF] resources:
[INF]
[INF] -before-resources:
[INF]
[INF] -before-inherit-resources:
[INF]
[INF] -before-copy-resources:
[INF]
[INF] -init:
[INF]
[INF] -init-compiler:
[INF]
[INF] -resources:
[INF] merging resources into D:\wamp\www\myapp\build\native\myapp\resources
[INF] merged 0 resources into D:\wamp\www\myapp\build\native\myapp\resources
[INF] merging resources into D:\wamp\www\myapp\build\native\myapp
[INF] merged 0 resources into D:\wamp\www\myapp\build\native\myapp
[INF]
[INF] -after-copy-resources:
[INF]
[INF] -after-inherit-resources:
[INF]
[INF] -after-resources:
[INF]
[INF] sass:
[INF]
[INF] -before-sass:
[INF]
[INF] -compass-compile-theme-package:
[INF]
[INF] -compass-compile-theme-folders:
[INF]
[INF] -compass-compile-sass-dir:
[INF] executing compass using system installed ruby runtime
identical ../css/app.css
[INF]
[INF] -compass-compile:
[INF]
[INF] -sass:
[INF]
[INF] -after-sass:
[INF]
[INF] slice:
[INF]
[INF] -before-slice:
[INF]
[INF] -slice-images:
[INF]
[INF] -slice:
[INF]
[INF] -after-slice:
[INF]
[INF] page:
[INF]
[INF] -before-page:
[INF]
[INF] -init:
[INF]
[INF] -init-compiler:
[INF]
[INF] -copy-app-resources:
[INF] Copying page resources to D:\wamp\www\myapp\build\native\myapp
[INF] copying D:\wamp\www\myapp\resources\css\app.css to D:\wamp\www\myapp\build\native\myapp\resources\css\app.css
[INF]
[INF] -generate-deltas:
[INF]
[INF] -detect-app-build-properties:
[INF]
[INF] -build-standalone-json-manifest:
[INF] Writing content to D:\wamp\www\myapp/build/native/myapp/app.json
[INF]
[INF] -build-output-page:
[INF]
[INF] -build-output-microload-page:
[INF] Writing content to D:\wamp\www\myapp/build/native/myapp/microloader.js
[INF] Appending content to D:\wamp\www\myapp/build/native/myapp/microloader.js
[INF] Building output markup to D:\wamp\www\myapp/build/native/myapp/index.html
[INF] [delete] Deleting: D:\wamp\www\myapp\build\native\myapp\microloader.js
[INF]
[INF] -generate-cache-manifest:
[INF]
[INF] -page:
[INF]
[INF] -after-page:
[INF]
[INF] native-package:
[INF]
[INF] -before-native-package:
[INF]
[INF] -native-package-mobile:
[INF] [echo] Building all specified mobile packager configs.
[INF] [echo]
[INF] [echo] Processing Mobile Packager config file
[INF] [echo] config: D:\wamp\www\myapp/packager.json
[INF] [echo] inputPath: D:\wamp\www\myapp/build/native/myapp
[INF] [echo] outputPath: D:\wamp\www\myapp/build/native-package-mobile/myapp/packager.json
[INF] [echo] Running mobile packager action build on file D:\wamp\www\myapp/packager.temp.json
[ERR]
Created directory D:\wamp\www\myapp\build\native-package-mobile\myapp\packager.json\src\com\xiubo\myapp
Added file D:\wamp\www\myapp\build\native-package-mobile\myapp\packager.json\src\com\xiubo\myapp\STActivity.java
Created directory D:\wamp\www\myapp\build\native-package-mobile\myapp\packager.json\res
Created directory D:\wamp\www\myapp\build\native-package-mobile\myapp\packager.json\bin
Created directory D:\wamp\www\myapp\build\native-package-mobile\myapp\packager.json\libs
Created directory D:\wamp\www\myapp\build\native-package-mobile\myapp\packager.json\res\values
Added file D:\wamp\www\myapp\build\native-package-mobile\myapp\packager.json\res\values\strings.xml
Created directory D:\wamp\www\myapp\build\native-package-mobile\myapp\packager.json\res\layout
Added file D:\wamp\www\myapp\build\native-package-mobile\myapp\packager.json\res\layout\main.xml
Created directory D:\wamp\www\myapp\build\native-package-mobile\myapp\packager.json\res\drawable-xhdpi
Created directory D:\wamp\www\myapp\build\native-package-mobile\myapp\packager.json\res\drawable-hdpi
Created directory D:\wamp\www\myapp\build\native-package-mobile\myapp\packager.json\res\drawable-mdpi
Created directory D:\wamp\www\myapp\build\native-package-mobile\myapp\packager.json\res\drawable-ldpi
Added file D:\wamp\www\myapp\build\native-package-mobile\myapp\packager.json\AndroidManifest.xml
Added file D:\wamp\www\myapp\build\native-package-mobile\myapp\packager.json\build.xml
Added file D:\wamp\www\myapp\build\native-package-mobile\myapp\packager.json\proguard-project.txt
¡Á??????¨°???? D:\wamp\www\myapp\build\native-package-mobile\myapp\packager.json\\libs\ ??????????
¡Á??????¨°???? D:\wamp\www\myapp\build\native-package-mobile\myapp\packager.json\\assets\ ??????????
Buildfile: D:\wamp\www\myapp\build\native-package-mobile\myapp\packager.json\build.xml

-set-mode-check:

-set-debug-files:

-check-env:
[checkenv] Android SDK Tools Revision 22.3.0
[checkenv] Installed at D:\Program Files\android-sdk-windows\sdk

-setup:
[echo] Project Name: myapp
[gettype] Project Type: Application

-set-debug-mode:

-debug-obfuscation-check:

-pre-build:

-build-setup:
[getbuildtools] Using latest Build Tools: 19.0.0
[echo] Resolving Build Target for myapp...
[gettarget] Project Target: Android 4.1.2
[gettarget] API level: 16
[echo] ----------
[echo] Creating output directories if needed...
[mkdir] Created dir: D:\wamp\www\myapp\build\native-package-mobile\myapp\packager.json\bin\res
[mkdir] Created dir: D:\wamp\www\myapp\build\native-package-mobile\myapp\packager.json\bin\rsObj
[mkdir] Created dir: D:\wamp\www\myapp\build\native-package-mobile\myapp\packager.json\bin\rsLibs
[mkdir] Created dir: D:\wamp\www\myapp\build\native-package-mobile\myapp\packager.json\gen
[mkdir] Created dir: D:\wamp\www\myapp\build\native-package-mobile\myapp\packager.json\bin\classes
[mkdir] Created dir: D:\wamp\www\myapp\build\native-package-mobile\myapp\packager.json\bin\dexedLibs
[echo] ----------
[echo] Resolving Dependencies for myapp...
[dependency] Library dependencies:
[dependency] No Libraries
[dependency]
[dependency] ------------------
[echo] ----------
[echo] Building Libraries with 'debug'...
[subant] No sub-builds to iterate on

-code-gen:
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[echo] ----------
[echo] Handling Resources...
[aapt] Generating resource IDs...
[echo] ----------
[echo] Handling BuildConfig class...
[buildconfig] Generating BuildConfig class.

-pre-compile:

-compile:
[javac] Compiling 3 source files to D:\wamp\www\myapp\build\native-package-mobile\myapp\packager.json\bin\classes

-post-compile:

-obfuscate:

-dex:
[dex] input: D:\wamp\www\myapp\build\native-package-mobile\myapp\packager.json\bin\classes
[dex] input: D:\wamp\www\myapp\build\native-package-mobile\myapp\packager.json\libs\guava-r09.jar
[dex] input: D:\wamp\www\myapp\build\native-package-mobile\myapp\packager.json\libs\gcm.jar
[dex] input: D:\wamp\www\myapp\build\native-package-mobile\myapp\packager.json\libs\nimblekit.jar
[dex] input: D:\wamp\www\myapp\build\native-package-mobile\myapp\packager.json\libs\commons-codec.jar
[dex] input: D:\wamp\www\myapp\build\native-package-mobile\myapp\packager.json\libs\sqlcipher.jar
[dex] Pre-Dexing D:\wamp\www\myapp\build\native-package-mobile\myapp\packager.json\libs\guava-r09.jar -> guava-r09-6b26029ba5c5c64deca7abc18bdbd46a.jar
[dex] Pre-Dexing D:\wamp\www\myapp\build\native-package-mobile\myapp\packager.json\libs\gcm.jar -> gcm-b67a455e8cf4e7928c0b82a43c0eaf71.jar
[dex] Pre-Dexing D:\wamp\www\myapp\build\native-package-mobile\myapp\packager.json\libs\nimblekit.jar -> nimblekit-55e21e61378ef4231d2762729fb533e8.jar
[dex] Pre-Dexing D:\wamp\www\myapp\build\native-package-mobile\myapp\packager.json\libs\commons-codec.jar -> commons-codec-a607d24060085016c6270afbd6fb2bd5.jar
[dex] Pre-Dexing D:\wamp\www\myapp\build\native-package-mobile\myapp\packager.json\libs\sqlcipher.jar -> sqlcipher-98f481e88e52b1031a529d6932a3c287.jar
[dex] Converting compiled files and external libraries into D:\wamp\www\myapp\build\native-package-mobile\myapp\packager.json\bin\classes.dex...
[dx]
[dx] UNEXPECTED TOP-LEVEL EXCEPTION:
[dx] java.nio.BufferOverflowException
[dx] at java.nio.Buffer.nextPutIndex(Buffer.java:519)
[dx] at java.nio.HeapByteBuffer.putShort(HeapByteBuffer.java:315)
[dx] at com.android.dex.Dex$Section.writeShort(Dex.java:818)
[dx] at com.android.dex.Dex$Section.writeTypeList(Dex.java:870)
[dx] at com.android.dx.merge.DexMerger$3.write(DexMerger.java:437)
[dx] at com.android.dx.merge.DexMerger$3.write(DexMerger.java:423)
[dx] at com.android.dx.merge.DexMerger$IdMerger.mergeUnsorted(DexMerger.java:317)
[dx] at com.android.dx.merge.DexMerger.mergeTypeLists(DexMerger.java:423)
[dx] at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:163)
[dx] at com.android.dx.merge.DexMerger.merge(DexMerger.java:187)
[dx] at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:439)
[dx] at com.android.dx.command.dexer.Main.runMonoDex(Main.java:287)
[dx] at com.android.dx.command.dexer.Main.run(Main.java:230)
[dx] at com.android.dx.command.dexer.Main.main(Main.java:199)
[dx] at com.android.dx.command.Main.main(Main.java:103)

BUILD FAILED
D:\Program Files\android-sdk-windows\sdk\tools\ant\build.xml:892: The following error occurred while executing this line:
D:\Program Files\android-sdk-windows\sdk\tools\ant\build.xml:894: The following error occurred while executing this line:
D:\Program Files\android-sdk-windows\sdk\tools\ant\build.xml:906: The following error occurred while executing this line:
D:\Program Files\android-sdk-windows\sdk\tools\ant\build.xml:284: null returned: 2

Total time: 17 seconds
""D:/Program Files/android-sdk-windows/sdk\tools\android" create project --target android-16 --name myapp --activity STActivity --path "D:\wamp\www\myapp/build/native-package-mobile/myapp/packager.json\/" --package com.xiubo.myapp"
Could not run ant with error: 1
Failed to package application

[ERR]
[ERR] BUILD FAILED
[ERR] com.sencha.exceptions.ExProcess: stbuild exited with non-zero code : 7
[ERR] at org.apache.tools.ant.Target.performTasks(Targ
[ERR] et.java:413)
[ERR]
[ERR] Total time: 27 seconds
[ERR] The following error occurred while executing this line:
D:\wamp\www\myapp\.sencha\app\build-impl.xml:422: The following error occurred while executing this line:
D:\wamp\www\myapp\.sencha\app\packager-impl.xml:112: The following error occurred while executing this line:
D:\wamp\www\myapp\.sencha\app\packager-impl.xml:114: The following error occurred while executing this line:
D:\wamp\www\myapp\.sencha\app\packager-impl.xml:98: The following error occurred while executing this line:
D:\wamp\www\myapp\.sencha\app\packager-impl.xml:7: com.sencha.exceptions.ExProcess: stbuild exited with non-zero code : 7

Vincent的柔情的主页 Vincent的柔情 | 初学一级 | 园豆:27
提问于:2013-12-17 19:30
< >
分享
最佳答案
1

如果我没记错, 这个应该是由于最新版本的build tool的bug, 只要在 SDK Manager中下载一个Android 4.3 (API 18)的build tool就可以了。 但是要把原目录中的19的删除掉

收获园豆:180
RamondLee | 菜鸟二级 |园豆:382 | 2013-12-17 22:06

万分感谢!!!这些天我都快被这个东西搞残了,两眼污黑。希望以后能和你多多交流。

Vincent的柔情 | 园豆:27 (初学一级) | 2013-12-17 23:37

谢谢,你的回答解决了我的问题,非常感谢

lagel | 园豆:200 (初学一级) | 2014-03-15 15:40

@lagel:你好,我现在碰到同样的问题,你怎么解决的啊

小熊卡卡 | 园豆:200 (初学一级) | 2014-10-07 16:59

@小熊卡卡: 就是这个回答那样解决嘛,在Android SDK Manager中,找到Tools里面修改Build-tools.

lagel | 园豆:200 (初学一级) | 2014-10-07 17:18
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册