Eclipse で問題なくビルドできるプロジェクトがありますが、「ant デバッグ」を実行すると ZipException がスローされます。出力は次のとおりです (パスとプロジェクト名は除外されます)。
-dex:
[dex] Converting compiled files and external libraries into /home/.../Android/[folder]/bin/classes.dex...
[dx]
[dx] UNEXPECTED TOP-LEVEL EXCEPTION:
[dx] java.util.zip.ZipException: error in opening zip file
[dx] at java.util.zip.ZipFile.open(Native Method)
[dx] at java.util.zip.ZipFile.<init>(ZipFile.java:131)
[dx] at java.util.zip.ZipFile.<init>(ZipFile.java:148)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:206)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:131)
[dx] at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:109)
[dx] at com.android.dx.command.dexer.Main.processOne(Main.java:418)
[dx] at com.android.dx.command.dexer.Main.processAllFiles(Main.java:329)
[dx] at com.android.dx.command.dexer.Main.run(Main.java:206)
[dx] at com.android.dx.command.dexer.Main.main(Main.java:174)
[dx] at com.android.dx.command.Main.main(Main.java:95)
[dx] 1 error; aborting
BUILD FAILED
/home/.../android-sdk-linux_x86/tools/ant/build.xml:818: The following error occurred while executing this line:
/home/.../android-sdk-linux_x86/tools/ant/build.xml:820: The following error occurred while executing this line:
/home/.../android-sdk-linux_x86/tools/ant/build.xml:832: The following error occurred while executing this line:
/home/.../android-sdk-linux_x86/tools/ant/build.xml:278: null returned: 1
このプロジェクトは、別のライブラリ プロジェクトを参照するライブラリ プロジェクトを参照しています。そう
プロジェクト A -> プロジェクト B -> プロジェクト C
私にとって奇妙な点は、Eclipse からのインストールはすべて完璧に機能するということですが、Ant からプロジェクトをビルドできるようにする必要があります。
私は成功せずに答えを探しました。役に立たなかったSOの同様の質問
Jenkins で Android プロジェクトをコンパイルしているときに、この ZipException を修正するにはどうすればよいですか?
単体テストを実行するための ant の構成。ライブラリはどこにあるべきですか?クラスパスはどのように構成する必要がありますか? ZipException の回避