Unable to build Android Application when proguard rules are enabled

2730


I have enabled proguard rules on my Android app, Following is the configuration

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

But when I build, I am getting the following exception

Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'. > Job failed, see logs for details

1 Answer

6 years ago by

I have added the following ignores, which fixed my problem.


-dontwarn java.nio.file.Files
-dontwarn java.nio.file.Path
-dontwarn java.nio.file.OpenOption
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement

-keep class android.support.v7.widget.SearchView { *; }

-ignorewarnings
-keep class * {
    public private *;
}
6 years ago by Karthik Divi