Proguard的失败,"不能写资源[META-INF / MANIFEST.MF](重复ZIP条目)" [英] Proguard fails with "can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry)"

查看:1618
本文介绍了Proguard的失败,"不能写资源[META-INF / MANIFEST.MF](重复ZIP条目)"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用的IntelliJ和运行Proguard的在调试模式,但我似乎无法摆脱的警告,如:

I'm using IntelliJ and running Proguard in debug mode but I can't seem to get rid of warnings such as:

ProGuard: [MyApplication] Warning: can't write resource [META-INF/MANIFEST.MF] 
(Duplicate zip entry [android-support-v13.jar:META-INF/MANIFEST.MF])

该项目有几个模块和 Android的支持 - v13.jar 正在对2人使用。我认为这是问题,所以我删除该库从libs文件夹,增加一条,作为一个项目库,并添加了依赖于这两个模块。这并没有解决任何问题,警告仍然存在,我不明白为什么。

This project has a couple of modules and android-support-v13.jar is being used on 2 of them. I thought that was the issue so I removed that library from the libs folder, added it as a project library and added the dependency to both modules. That didn't solve anything, the warning persists and I don't understand why.

我知道这些警告并不影响什么,但一个干净的构建是一个快乐的构建!

I know these warnings don't affect anything but a clean build is a happy build!

推荐答案

可能是'proguard.cfg问题。是否包括任何'-injars?如果您的项目包含另一个项目作为一个库,罐可处理两次。你能将你的proguard.cfg?

Possibly a 'proguard.cfg' problem. Does it include any '-injars'? If your project includes another project as a library, jars can be processed twice. Could you post your 'proguard.cfg'?

从<一个提取href="http://proguard.sourceforge.net/index.html#manual/troubleshooting.html">http://proguard.sourceforge.net/index.html#manual/troubleshooting.html:

您输入罐包含具有相同名称的多个资源文件。   ProGuard的继续复制的资源文件像往常一样,跳过任何   其中$ p $文件pviously使用的名称。再次,该警告可以是   有些问题虽然迹象,所以它的最好移除   重复。一个方便的方法,这样做是对的指定过滤器   输入罐子。没有选项关掉这些警告。

Your input jars contain multiple resource files with the same name. ProGuard continues copying the resource files as usual, skipping any files with previously used names. Once more, the warning may be an indication of some problem though, so it's advisable to remove the duplicates. A convenient way to do so is by specifying filters on the input jars. There is no option to switch off these warnings.

选项1:

正如你不能发表你的'-injars,检查它们是否包含任何Android的支持,v13.jar或库包含在您的项目,该项目本身还包括Android的支持 - v13.jar。

As you can't post your '-injars', check if they include either 'android-support-v13.jar' or the library included in your project which itself also includes 'android-support-v13.jar'.

假设你正在与蚂蚁的IntelliJ IDEA里面,你必须不加-injars,-outjars,或-libraryjars选项; Ant脚本已经这样做了你。

选项2:

虽然警告是无害的,干净的构建是一个快乐的构建,所以尝试:

Although the warnings are harmless, a clean build is a happy build, so try:

<一个href="http://www.dancartoon.com/2012/01/14/fixing-proguard-warning-cant-write-resource-meta-infmanifest-mf/">http://www.dancartoon.com/2012/01/14/fixing-proguard-warning-cant-write-resource-meta-infmanifest-mf/

https://gist.github.com/paulpv/4439012

#3选项:

包括(!META-INF / MANIFEST.MF)每个-injars命令后,

Include (!META-INF/MANIFEST.MF) after each '-injars' command

-injars library.jar(!META-INF/MANIFEST.MF)

第4个选项: Android的Proguard的重复定义

通过将第三方库到其他目录固定这一点,   我的情况下,'库'。然后添加

Fixed this by moving the 3rd party libraries to another directory, in my case 'lib'. Then added

-injars lib/jmdns.jar 

     

到proguard.cfg文件。

to the proguard.cfg file.

选项#5: Android的 - Proguard的重复的ZIP条目错误

如果您Proguard的配置文件包含以下行,将其删除:

If your Proguard config file includes the following line, remove it:

-injars bin/classes

选项#6: <一个href="http://stackoverflow.com/questions/6542631/android-obfuscate-app-using-proguard-keeps-obfuscating-library-jars-or-is-it">Android使用ProGuard的不断混淆的jar包混淆的应用程序 - 或者是

我发现了另一个方法,使Proguard的离开图书馆罐子独显   问到preserve自己的包名,例如:

I found another way to make Proguard leave library jars alone was to ask it to preserve their package names, eg:

-keep类的javax ** {。 }   。-keep类组织的* {; }   。-keep类twitter4j 的* {*; }

-keep class javax.** { ; } -keep class org.* { ; } -keep class twitter4j.* { *; }

选项#7:

一个奇怪的解决方案(在删除src文件夹中的META-INF文件夹),以类似的东西 href="http://jira.$c$chaus.org/browse/MNGECLIPSE-994">。

A weird solution (deleting META-INF folder in src folder) to something similar here.

这篇关于Proguard的失败,&QUOT;不能写资源[META-INF / MANIFEST.MF](重复ZIP条目)&QUOT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆