Firebase remote config update to 19.2.0 failure with Duplicate class com.google.protobuf.AbstractMessageLite found
See original GitHub issue[READ] Step 1: Are you in the right place?
Unable to update the firebase remote config dependency to 19.2.0
Seeing the following error
Duplicate class com.google.protobuf.AbstractMessageLite found in modules jetified-protobuf-javalite-3.11.0.jar (com.google.protobuf:protobuf-javalite:3.11.0) and jetified-protobuf-lite-3.0.1.jar (com.google.protobuf:protobuf-lite:3.0.1)
Complete error log : error.txt
[REQUIRED] Step 2: Describe your environment
-
Android Studio version: 4.0.1
-
Firebase Component:Firebase remote config 19.2.0 Following firebase dependencies are used : const val config = “com.google.firebase:firebase-config:19.2.0” const val auth = “com.google.firebase:firebase-auth:19.1.0” const val database = “com.google.firebase:firebase-database:19.2.0” const val storage = “com.google.firebase:firebase-storage:19.1.0” const val mlvision = “com.google.firebase:firebase-ml-vision:18.0.2” const val mlvision_barcode_model = “com.google.firebase:firebase-ml-vision-barcode-model:16.1.1” const val messaging = “com.google.firebase:firebase-messaging:20.1.5” const val fire_store = “com.google.firebase:firebase-firestore:21.5.0” const val crashlytics = “com.google.firebase:firebase-crashlytics:17.0.0” const val crashlytics_gradle = “com.google.firebase:firebase-crashlytics-gradle:2.1.0” const val analytics = “com.google.firebase:firebase-analytics:17.4.2”
-
Component version: _____
[REQUIRED] Step 3: Describe the problem
Seeing the above mentioned error after updating the firebase remote config dependency to 19.2.0
-
Followed the solution mentioned here : https://stackoverflow.com/questions/62764605/updated-firebase-dependency-and-got-duplicated-protobuf-classes-error : Still seeing the error after updating the dependencies as suggested.
-
Tried adding the following work around as suggested on some of the threads here
configurations { all { exclude(group = "com.google.protobuf", module = "protobuf-javalite") } }
We suspect the following crash is observed with the workaround
Fatal Exception: java.lang.NoSuchMethodError No static method registerDefaultInstance(Ljava/lang/Class;Lcom/google/protobuf/GeneratedMessageLite;)V in class Lcom/google/protobuf/GeneratedMessageLite; or its super classes (declaration of 'com.google.protobuf.GeneratedMessageLite' appears in base.apk!classes7.dex) com.google.firebase.remoteconfig.proto.ConfigPersistence$PersistedConfig.<clinit> (ConfigPersistence.java:813) com.google.firebase.remoteconfig.proto.ConfigPersistence$PersistedConfig.parseFrom (ConfigPersistence.java:402) com.google.firebase.remoteconfig.internal.LegacyConfigsHandler.readPersistedConfig (LegacyConfigsHandler.java:340) com.google.firebase.remoteconfig.internal.LegacyConfigsHandler.getConvertedLegacyConfigs (LegacyConfigsHandler.java:196) com.google.firebase.remoteconfig.internal.LegacyConfigsHandler.saveLegacyConfigsIfNecessary (LegacyConfigsHandler.java:151) com.google.firebase.remoteconfig.RemoteConfigComponent$$Lambda$4.call (RemoteConfigComponent.java:2) com.google.android.gms.tasks.zzz.run (zzz.java:2) java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1167) java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641) java.lang.Thread.run (Thread.java:919)
Steps to reproduce:
Just updated the remote config dependency to 19.2.0
None of our dependencies are introducing the protobuf-java
dependency
here are the dependencies : deps.txt
Relevant Code:
// TODO(you): code here to reproduce the problem
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (1 by maintainers)
Top GitHub Comments
Taking a look at https://developer.android.com/jetpack/androidx/releases/security all releases of
androidx.security:security-crypto
have been either alpha, beta or RC; no stable release yet, e.g. 1.0.0. Depending on a non stable release allows you to get the latest features, but they have an inherent risk. Wikipedia has a nice article with the difference between each typehttps://en.wikipedia.org/wiki/Software_release_life_cycle#Stages_of_development
Depending on the RC instead of the beta, as it was before, is less risky, but keep in mind that it’s still not the same as a stable release.
Try updating
androidx.security:security-crypto:1.0.0-beta01
to one of the RChttps://developer.android.com/jetpack/androidx/releases/security
They used to pull protobuf at a dependency, but it’s gone in the RCs