Unable to build Android Application when proguard rules are enabled

Views: 947 Ask New Question

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 following exception

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

1 Answer

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 { *; }

-keep class * {
    public private *;
On By

Answer This Question