Android 中的 Proguard
我正在使用 proGuard 来混淆我的应用程序。我在应用程序中包含了库 jar,并且使用 ant 来构建应用程序。但在构建阶段我遇到了以下异常。
-dex:
[dex] Converting compiled files and external libraries into /home/fiberlink/Desktop/Work/MaaS360/Maas360ControlAgent/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:127)
[dx] at java.util.zip.ZipFile.<init>(ZipFile.java:144)
[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
我不明白问题是什么...请有人帮忙...
I am using proGuard to obfuscate my application. I included library jars in my application and I am using ant to build the application. But in the building phase I am getting the following exception.
-dex:
[dex] Converting compiled files and external libraries into /home/fiberlink/Desktop/Work/MaaS360/Maas360ControlAgent/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:127)
[dx] at java.util.zip.ZipFile.<init>(ZipFile.java:144)
[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
I am not getting what the problem is... Somebody Please help...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您的
proguard.cfg
文件是什么样的?您还需要在default.properties
文件中添加proguard.config=proguard.cfg
(稍后在 API 级别进行更改)。我的在下面,并且工作正常。
What does your
proguard.cfg
file look like? You'll also wantproguard.config=proguard.cfg
in yourdefault.properties
file (changed later on API level).Mine is below, and works fine.
确保在使用 Proguard 时不要忘记有关 Android 的任何特殊信息的最佳方法是将 SDK 中的文件作为基本文件,位于此处:
该文件有详细记录并预设了需要为 Android 应用程序设置的每个参数。
The best way to be sure not to forget anything special regarding Android when using Proguard is to take as a base file the one from the SDK, located here :
This file is well documented and preset every parameters that need to be set for an Android application.