无法使用proguard构建发布apk

时间:2017-08-12 12:59:46

标签: android gradle build proguard

无法使用proguard构建发布apk。没有proguard一切都很好。我在互联网上找到了许多其他的proguard规则,但没有成功。我怀疑问题是我使用了VectorDrawable和minApi 19。

Gradle output

    -ignorewarnings

    # Remove logs
    -assumenosideeffects class android.util.Log {
        public static boolean isLoggable(java.lang.String, int);
        public static int v(...);
        public static int i(...);
        public static int w(...);
        public static int d(...);
        public static int e(...);
    }

    # BaseRecyclerViewAdapterHelper
    -keep class com.chad.library.adapter.** {
        *;
    }
    -keep public class * extends com.chad.library.adapter.base.BaseQuickAdapter
    -keep public class * extends com.chad.library.adapter.base.BaseViewHolder
    -keepclassmembers public class * extends com.chad.library.adapter.base.BaseViewHolder {
        (android.view.View);
    }

    # Glide specific rules #
    -keep public class * implements com.bumptech.glide.module.GlideModule
    -keep public class * extends com.bumptech.glide.AppGlideModule
    -keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** {
        **[] $VALUES;
        public *;
    }

    # Realm
    -keep class io.realm.annotations.RealmModule
    -keep @io.realm.annotations.RealmModule class *
    -keep class io.realm.internal.Keep
    -keep @io.realm.internal.Keep class *
    -dontwarn javax.**
    -dontwarn io.realm.**

    # Retrofit 2.X
    -dontwarn retrofit2.**
    -keep class retrofit2.** { *; }
    -keepattributes Signature
    -keepattributes Exceptions
    -keepclasseswithmembers class * {
        @retrofit2.http.* ;
    }
    -dontwarn retrofit2.Platform$Java8

    # OkHttp
    -keepattributes Signature
    -keepattributes *Annotation*
    -keep class okhttp3.** { *; }
    -keep interface okhttp3.** { *; }
    -dontwarn okhttp3.**

    # Okio
    -dontwarn okio.**
    -dontwarn org.codehaus.**
    -dontwarn java.nio.**
    -dontwarn java.lang.invoke.**
    -dontwarn rx.**

Android studio 3.0 Beta 2

Graddle版本4.1

0 个答案:

没有答案
相关问题