Android proguard发布问题

时间:2017-01-26 15:42:54

标签: java android android-studio android-gradle android-proguard

在Gradle中启用minify以将apk缩小为释放模式后,我得到了

Warning:Exception while processing task java.io.IOException: Please correct the above warnings first.
Error:Execution failed for task ':ProjectName:transformClassesAndResourcesWithProguardForRelease'.
Job failed, see logs for details

Android插件版本2.2.3,Gradle版本2.14.1。

buildTypes {
  release {
    debuggable false
    minifyEnabled true
    proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}

我的proguard-rules.txt如下:

-keep class com.wooplr.spotlight.** { *; }
-keep interface com.wooplr.spotlight.**
-keep enum com.wooplr.spotlight.**
-dontwarn javax.servlet.**
-dontwarn org.joda.time.**
-dontwarn org.w3c.dom.**
-dontwarn jcifs.http.NetworkExplorer.**
-keep class com.github.mikephil.charting.** { *; }
-dontwarn io.realm.**
-dontwarn org.apache.commons.**
-keep class org.apache.http.** { *; }
-dontwarn org.apache.http.*
-dontwarn org.codehaus.jackson.**
-keep  class org.codehaus.jackson.** { *; }

在log cat中:

Warning:there were 328 unresolved references to classes or interfaces.
Warning:there were 17 instances of library classes depending on program classes.
Warning:there were 32 unresolved references to program class members.
Warning:there were 1 unresolved references to library class members.
Warning:Exception while processing task java.io.IOException: Please correct the above warnings first.

0 个答案:

没有答案