2

I updated my Android Studio to v3.5 yesterday and I am getting the following error while trying to build a new release build.

FAILURE: Build failed with an exception.

*What went wrong:

Execution failed for task ':app:transformClassesAndResourcesWithR8ForDevRelease'.

java.lang.IllegalArgumentException: Multiple entries with same key: Method com.google.firebase.crash.FirebaseCrash.zza Proto VZZ void boolean boolean=Encoded method Method com.google.firebase.crash.FirebaseCrash.zza Proto VZZ void boolean boolean and Method com.google.firebase.crash.FirebaseCrash.zza Proto VZZ void boolean boolean=Encoded method Method com.google.firebase.crash.FirebaseCrash.zza Proto VZZ void boolean boolean

Already referred to post because before this I was getting the same error for FirebaseInstanceId.

I added the following in my proguard-rules.pro file

-keep class com.google.firebase.iid.FirebaseInstanceId { zza(...); }

-keep class com.google.firebase.iid.FirebaseCrash { zza(...); }

but it did not work for FirebaseCrash class.

Dhara Bhavsar
  • 345
  • 4
  • 11

1 Answers1

1

After updating Android Studio to 3.5:

  1. Update Gradle 5.4.1
  2. In Top-Level build.gradle update classpath 'com.google.gms:google-services:4.3.1'
  3. Add -allowaccessmodification to your proguard file.

If you get this warning: enter image description here Add the dependency to force using the latest:

implementation "androidx.versionedparcelable:versionedparcelable:1.1.0"
Pierre
  • 8,397
  • 4
  • 64
  • 80
  • I updated the proguard file, forced the latest version of versionedParcelable, re-enabled R8 but the release build is still not being generated with the same error as above. – Dhara Bhavsar Aug 28 '19 at 21:59
  • These changes (update to 4.3.1, -allowaccessmodification) work for me. – tangens Sep 02 '19 at 09:40
  • 1
    Worked for me after I removed the FirebaseCrash library implementation from app's gradle file. – Dhara Bhavsar Sep 04 '19 at 15:26