1

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.

KUSHA B K
  • 1,489
  • 13
  • 20
  • Try this link https://stackoverflow.com/questions/47893266/build-failing-on-play-services11-8-x-with-pro-guard-parser-error – Ankita Feb 22 '18 at 09:57
  • Thank-you actually I'd tried this before but I miss a statement. Anyways now it worked but when I tries to rebuild the project I got the following error: **Execution failed for task ':app:transformClassesAndResourcesWithProguardForDebug'.** – Muhammad Salman Siddiqi Feb 22 '18 at 10:35

2 Answers2

1

proguard issue. Use keep class for all libraries

KKSINGLA
  • 1,284
  • 2
  • 10
  • 22
1

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

ddassa
  • 309
  • 1
  • 6