Linux上的“Cordova build android”错误:java.util.zip.ZipException:设置了无效的代码长度

时间:2014-08-13 12:06:36

标签: cordova android-build

我刚刚开始使用Cordova,而且我能够构建&在Linux和Max上运行“hello”应用程序。 然后我尝试通过创建一个空项目(使用cli)并将app文件复制到“www”文件夹来包装现有项目。 这适用于Mac / iOS,我能够构建&运行,但同样的应用程序无法在Android的Linux机器上构建。

构建输出摘录:

-package:
[apkbuilder] Current build type is different than previous build: forced apkbuilder run.
[apkbuilder] Creating Testapp-debug-unaligned.apk and signing it with a debug key...
BUILD FAILED
/scratch/msmith/android/adt-bundle-linux-x86_64-20140702/sdk/tools/ant/build.xml:962: 
The following error occurred while executing this line:
/scratch/msmith/android/adt-bundle-linux-x86_64-20140702/sdk/tools/ant/build.xml:973: 
The following error occurred while executing this line:
/scratch/msmith/android/adt-bundle-linux-x86_64-20140702/sdk/tools/ant/build.xml:312: com.android.sdklib.build.ApkCreationException: Failed to add /scratch/msmith/test/cordova/testapp/platforms/android/bin/Testapp.ap_
    at com.android.sdklib.build.ApkBuilder.addZipFile(ApkBuilder.java:547)
    at com.android.sdklib.build.ApkBuilder.init(ApkBuilder.java:453)
    at com.android.sdklib.build.ApkBuilder.<init>(ApkBuilder.java:394)
    at com.android.ant.ApkBuilderTask.execute(ApkBuilderTask.java:334)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
<I removed several lines here>
Caused by: java.util.zip.ZipException: invalid code lengths set
    at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:164)
    at java.util.zip.ZipInputStream.read(ZipInputStream.java:193)
    at java.io.FilterInputStream.read(FilterInputStream.java:107)
    at com.android.sdklib.internal.build.SignedJarBuilder.writeEntry(SignedJarBuilder.java:311)
    at com.android.sdklib.internal.build.SignedJarBuilder.writeZip(SignedJarBuilder.java:244)
    at com.android.sdklib.build.ApkBuilder.addZipFile(ApkBuilder.java:540)

上述文件的大小为58760445。 无法添加/scratch/msmith/test/cordova/testapp/platforms/android/bin/Testapp.ap_ (我将我的info-zip版本升级到3.1 beta,并得到了同样的错误。)

0 个答案:

没有答案