ProGuard Configuration Parse Error, after enabling "minifyEnabled"

My Android project is working completely fine, but when I enabled this option minifyEnabled true I got following error:

com.android.build.gradle.shrinker.parser.ProguardParserException: ProGuard configuration parser error:
    /Users/mss/.gradle/caches/transforms-1/files-1.1/play-services-base-11.8.0.aar/a9e603bf098b2c6866a5bdd73147cdc0/proguard.txt line 3:88 no viable alternative at input '<fields>'

This is the error I received every time I try to run my application with minifyEnabled true. Is there any solution to this problem.

The dependencies I am using in my project are these:

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support:design:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.android.support:support-v4:26.1.0'
    implementation 'com.android.support:recyclerview-v7:26.1.0'
    implementation 'com.android.support:cardview-v7:26.1.0'
    implementation 'com.google.android.gms:play-services-auth:11.8.0'

    // Circle Image View
    implementation 'de.hdodenhof:circleimageview:2.2.0'

    // Firebase Dependencies
    implementation 'com.google.firebase:firebase-auth:11.8.0'
    implementation 'com.google.firebase:firebase-messaging:11.8.0'
    implementation 'com.google.firebase:firebase-crash:11.8.0'

    // Firebase UI Dependencies
    implementation 'com.firebaseui:firebase-ui-auth:3.1.0'

    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}

Moreover, configuration of app level build.gradle file are these:

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

    debug {
        debuggable true
     // minifyEnabled true
     // shrinkResources true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

I'd commented two lines minifyEnabled true and shrinkResources true because these two are creating the problem.

Upvotes: 1

Views: 1195

Answers (2)

ddassa
ddassa

Reputation: 309

You have to add custom proguard rules for each lib you add.

For Firebase rules look here; link

Most libraries list what are the progurad rules they use, look into library details and you will find them.

Moreover look into FirebaseUI-Android app proguard file here

Upvotes: 1

KKSINGLA
KKSINGLA

Reputation: 1344

proguard issue. Use keep class for all libraries

Upvotes: 1

Related Questions