Crashlytics ProGuard重复压缩条目

时间:2015-10-08 21:35:42

标签: android proguard

我正在尝试在Android应用上运行ProGuard。该应用程序在没有ProGuard的情况下构建并运行良好。

当我将build.gradle更改为“minifyEnabled true”时,我得到了一些警告,我可以通过proguard-rules.pro中的以下内容消除这些警告:

Warning:can't write resource [META-INF/COM_CRAS.SF] (Duplicate zip entry [crashlytics-1.1.13.jar:META-INF/COM_CRAS.SF])
Warning:can't write resource [META-INF/COM_CRAS.RSA] (Duplicate zip entry [crashlytics-1.1.13.jar:META-INF/COM_CRAS.RSA])
Warning:can't write resource [META-INF/maven/com.squareup.okhttp/okhttp/pom.properties] (Duplicate zip entry [crashlytics-1.1.13.jar:META-INF/maven/com.squareup.okhttp/okhttp/pom.properties])
Warning:can't write resource [META-INF/maven/com.squareup.okhttp/okhttp/pom.xml] (Duplicate zip entry [crashlytics-1.1.13.jar:META-INF/maven/com.squareup.okhttp/okhttp/pom.xml])
Warning:can't write resource [META-INF/maven/com.squareup/otto/pom.properties] (Duplicate zip entry [crashlytics-1.1.13.jar:META-INF/maven/com.squareup/otto/pom.properties])
Warning:can't write resource [META-INF/maven/com.squareup/otto/pom.xml] (Duplicate zip entry [crashlytics-1.1.13.jar:META-INF/maven/com.squareup/otto/pom.xml])
Warning:can't write resource [META-INF/maven/com.squareup.okhttp/okhttp-protocols/pom.properties] (Duplicate zip entry [crashlytics-1.1.13.jar:META-INF/maven/com.squareup.okhttp/okhttp-protocols/pom.properties])
Warning:can't write resource [META-INF/maven/com.squareup.okhttp/okhttp-protocols/pom.xml] (Duplicate zip entry [crashlytics-1.1.13.jar:META-INF/maven/com.squareup.okhttp/okhttp-protocols/pom.xml])

Error:org.gradle.internal.UncheckedException: java.io.IOException: Can't write [/Users/dano/workspace/COMPANY_NAME/COMPANY_NAME-android/COMPANY_NAME-android/COMPANY_NAME/app/build/intermediates/classes-proguard/COMPANY_NAMELive/release/classes.jar] (Can't read [/Users/dano/.gradle/caches/modules-2/files-2.1/com.crashlytics.android/crashlytics/1.1.13/e821eafa1bf489a26bdb71f95078c26785b37a1/crashlytics-1.1.13.jar(;;;;;;!META-INF/MANIFEST.MF)] (Duplicate zip entry [com/a/a/ae.class == crashlytics-1.1.13.jar:com/crashlytics/android/a.class]))

Error:java.io.IOException: Can't write [/Users/dano/workspace/COMPANY_NAME/COMPANY_NAME-android/COMPANY_NAME-android/COMPANY_NAME/app/build/intermediates/classes-proguard/COMPANY_NAMELive/release/classes.jar] (Can't read [/Users/dano/.gradle/caches/modules-2/files-2.1/com.crashlytics.android/crashlytics/1.1.13/e821eafa1bf489a26bdb71f95078c26785b37a1/crashlytics-1.1.13.jar(;;;;;;!META-INF/MANIFEST.MF)] (Duplicate zip entry [com/a/a/ae.class == crashlytics-1.1.13.jar:com/crashlytics/android/a.class]))

Error:java.io.IOException: Can't read [/Users/dano/.gradle/caches/modules-2/files-2.1/com.crashlytics.android/crashlytics/1.1.13/e821eafa1bf489a26bdb71f95078c26785b37a1/crashlytics-1.1.13.jar(;;;;;;!META-INF/MANIFEST.MF)] (Duplicate zip entry [com/a/a/ae.class == crashlytics-1.1.13.jar:com/crashlytics/android/a.class])

Error:java.io.IOException: Duplicate zip entry [com/a/a/ae.class == crashlytics-1.1.13.jar:com/crashlytics/android/a.class]

现在,当我尝试使用ProGuard进行构建时,我收到以下警告和错误(已编辑以添加错误消息):

packagingOptions {
exclude 'META-INF/COM_CRAS.SF'
exclude 'META-INF/COM_CRAS.RSA'
exclude 'META-INF/maven/com.squareup.okhttp/okhttp/pom.properties'
exclude 'META-INF/maven/com.squareup.okhttp/okhttp/pom.xml'
exclude 'META-INF/maven/com.squareup/otto/pom.properties'
exclude 'META-INF/maven/com.squareup/otto/pom.xml'
exclude 'META-INF/maven/com.squareup.okhttp-protocols/okhttp-protocols/pom.properties'
exclude 'META-INF/maven/com.squareup.okhttp-protocols/okhttp-protocols/pom.xml'
}

我已经尝试了以下几个其他SO查询:

在build.gradle中:

compile 'com.crashlytics.android:crashlytics:1.+' {
    exclude group: 'com.squareup.okhttp', module: 'okhttp'
}

-keepattributes *Annotation*,Signature

在proguard-rules.pro中:

-keep class <crashlytics | squareup | other>
-dontwarn <crashlytics | squareup | other>

和各种

{{1}}

我仍然得到相同的4个错误和8个警告。

我确信这是一件非常简单(并且可能是愚蠢的),我做错了,但我找不到任何可以推进构建的东西。

任何和所有建议都将(A)尝试和(B)赞赏。

0 个答案:

没有答案