Describe the bug
I noticed that the firebase Flutter plugin is still using an outdated version of protobuf. On Android native com.google.protobuf:protobuf-javalite:3.11.0 is used.
When I run ../gradlew dependencies :app:dependencies in my app I still see the old com.google.protobuf:protobuf-lite:3.0.1 . This leads to collisions with other plugins that are using the newer version.
Bug details
Click To Expand
Duplicate class com.google.protobuf.AbstractMessageLite found in modules jetified-protobuf-javalite-3.13.0.jar (com.google.protobuf:protobuf-javalite:3.13.0) and jetified-protobuf-lite-3.0.1.jar (com.google.protobuf:protobuf-lite:3.0.1)
Duplicate class com.google.protobuf.AbstractMessageLite$Builder found in modules jetified-protobuf-javalite-3.13.0.jar (com.google.protobuf:protobuf-javalite:3.13.0) and jetified-protobuf-lite-3.0.1.jar (com.google.protobuf:protobuf-lite:3.0.1)
Duplicate class com.google.protobuf.AbstractMessageLite$Builder$LimitedInputStream found in modules jetified-protobuf-javalite-3.13.0.jar (com.google.protobuf:protobuf-javalite:3.13.0) and jetified-protobuf-lite-3.0.1.jar (com.google.protobuf:protobuf-lite:3.0.1)
Duplicate class com.google.protobuf.AbstractParser found in modules jetified-protobuf-javalite-3.13.0.jar (com.google.protobuf:protobuf-javalite:3.13.0) and jetified-protobuf-lite-3.0.1.jar (com.google.protobuf:protobuf-lite:3.0.1)
Duplicate class com.google.protobuf.AbstractProtobufList found in modules jetified-protobuf-javalite-3.13.0.jar (com.google.protobuf:protobuf-javalite:3.13.0) and jetified-protobuf-lite-3.0.1.jar (com.google.protobuf:protobuf-lite:3.0.1)
Duplicate class com.google.protobuf.BooleanArrayList found in modules jetified-protobuf-javalite-3.13.0.jar (com.google.protobuf:protobuf-javalite:3.13.0) and jetified-protobuf-lite-3.0.1.jar (com.google.protobuf:protobuf-lite:3.0.1)
Duplicate class com.google.protobuf.ByteBufferWriter found in modules jetified-protobuf-javalite-3.13.0.jar (com.google.protobuf:protobuf-javalite:3.13.0) and jetified-protobuf-lite-3.0.1.jar (com.google.protobuf:protobuf-lite:3.0.1)
Duplicate class com.google.protobuf.ByteOutput found in modules jetified-protobuf-javalite-3.13.0.jar (com.google.protobuf:protobuf-javalite:3.13.0) and jetified-protobuf-lite-3.0.1.jar (com.google.protobuf:protobuf-lite:3.0.1)
Duplicate class com.google.protobuf.ByteString found in modules jetified-protobuf-javalite-3.13.0.jar (com.google.protobuf:protobuf-javalite:3.13.0) and jetified-protobuf-lite-3.0.1.jar (com.google.protobuf:protobuf-lite:3.0.1)
Duplicate class com.google.protobuf.ByteString$1 found in modules jetified-protobuf-javalite-3.13.0.jar (com.google.protobuf:protobuf-javalite:3.13.0) and jetified-protobuf-lite-3.0.1.jar (com.google.protobuf:protobuf-lite:3.0.1)
Duplicate class com.google.protobuf.ByteString$ArraysByteArrayCopier found in modules jetified-protobuf-javalite-3.13.0.jar (com.google.protobuf:protobuf-javalite:3.13.0) and jetified-protobuf-lite-3.0.1.jar (com.google.protobuf:protobuf-lite:3.0.1)
Duplicate class com.google.protobuf.ByteString$BoundedByteString found in modules jetified-protobuf-javalite-3.13.0.jar (com.google.protobuf:protobuf-javalite:3.13.0) and jetified-protobuf-lite-3.0.1.jar (com.google.protobuf:protobuf-lite:3.0.1)
Duplicate class com.google.protobuf.ByteString$ByteArrayCopier found in modules jetified-protobuf-javalite-3.13.0.jar (com.google.protobuf:protobuf-javalite:3.13.0) and jetified-protobuf-lite-3.0.1.jar (com.google.protobuf:protobuf-lite:3.0.1)
Duplicate class com.google.protobuf.ByteString$ByteIterator found in modules jetified-protobuf-javalite-3.13.0.jar (com.google.protobuf:protobuf-javalite:3.13.0) and jetified-protobuf-lite-3.0.1.jar (com.google.protobuf:protobuf-lite:3.0.1)
Duplicate class com.google.protobuf.ByteString$CodedBuilder found in modules jetified-protobuf-javalite-3.13.0.jar (com.google.protobuf:protobuf-javalite:3.13.0) and jetified-protobuf-lite-3.0.1.jar (com.google.protobuf:protobuf-lite:3.0.1)
Duplicate class com.google.protobuf.ByteString$LeafByteString found in modules jetified-protobuf-javalite-3.13.0.jar (com.google.protobuf:protobuf-javalite:3.13.0) and jetified-protobuf-lite-3.0.1.jar (com.google.protobuf:protobuf-lite:3.0.1)
Duplicate class com.google.protobuf.ByteString$LiteralByteString found in modules jetified-protobuf-javalite-3.13.0.jar (com.google.protobuf:protobuf-javalite:3.13.0) and jetified-protobuf-lite-3.0.1.jar (com.google.protobuf:protobuf-lite:3.0.1)
Duplicate class com.google.protobuf.ByteString$Output found in modules jetified-protobuf-javalite-3.13.0.jar (com.google.protobuf:protobuf-javalite:3.13.0) and jetified-protobuf-lite-3.0.1.jar (com.google.protobuf:protobuf-lite:3.0.1)
Duplicate class com.google.protobuf.ByteString$SystemByteArrayCopier found in modules jetified-protobuf-javalite-3.13.0.jar (com.google.protobuf:protobuf-javalite:3.13.0) and jetified-protobuf-lite-3.0.1.jar (com.google.protobuf:protobuf-lite:3.0.1)
Duplicate class com.google.protobuf.CodedInputStream found in modules jetified-protobuf-javalite-3.13.0.jar (com.google.protobuf:protobuf-javalite:3.13.0) and jetified-protobuf-lite-3.0.1.jar (com.google.protobuf:protobuf-lite:3.0.1)
Duplicate class com.google.protobuf.CodedOutputStream found in modules jetified-protobuf-javalite-3.13.0.jar (com.google.protobuf:protobuf-javalite:3.13.0) and jetified-protobuf-lite-3.0.1.jar (com.google.protobuf:protobuf-lite:3.0.1)
Duplicate class com.google.protobuf.CodedOutputStream$1 found in modules jetified-protobuf-javalite-3.13.0.jar (com.google.protobuf:protobuf-javalite:3.13.0) and jetified-protobuf-lite-3.0.1.jar (com.google.protobuf:protobuf-lite:3.0.1)
Duplicate class com.google.protobuf.CodedOutputStream$AbstractBufferedEncoder found in modules jetified-protobuf-javalite-3.13.0.jar (com.google.protobuf:protobuf-javalite:3.13.0) and jetified-protobuf-lite-3.0.1.jar (com.google.protobuf:protobuf-lite:3.0.1)
Duplicate class com.google.protobuf.CodedOutputStream$ArrayEncoder found in modules jetified-protobuf-javalite-3.13.0.jar (com.google.protobuf:protobuf-javalite:3.13.0) and jetified-protobuf-lite-3.0.1.jar (com.google.protobuf:protobuf-lite:3.0.1)
Duplicate class com.google.protobuf.CodedOutputStream$ByteOutputEncoder found in modules jetified-protobuf-javalite-3.13.0.jar (com.google.protobuf:protobuf-javalite:3.13.0) and jetified-protobuf-lite-3.0.1.jar (com.google.protobuf:protobuf-lite:3.0.1)
Duplicate class com.google.protobuf.CodedOutputStream$OutOfSpaceException found in modules jetified-protobuf-javalite-3.13.0.jar (com.google.protobuf:protobuf-javalite:3.13.0) and jetified-protobuf-lite-3.0.1.jar (com.google.protobuf:protobuf-lite:3.0.1)
Duplicate class com.google.protobuf.CodedOutputStream$OutputStreamEncoder found in modules jetified-protobuf-javalite-3.13.0.jar (com.google.protobuf:protobuf-javalite:3.13.0) and jetified-protobuf-lite-3.0.1.jar (com.google.protobuf:protobuf-lite:3.0.1)
Duplicate class com.google.protobuf.DoubleArrayList found in modules jetified-protobuf-javalite-3.13.0.jar (com.google.protobuf:protobuf-javalite:3.13.0) and jetified-protobuf-lite-3.0.1.jar (com.google.protobuf:protobuf-lite:3.0.1)
Duplicate class com.google.protobuf.ExperimentalApi found in modules jetified-protobuf-javalite-3.13.0.jar (com.google.protobuf:protobuf-javalite:3.13.0) and jetified-protobuf-lite-3.0.1.jar (com.google.protobuf:protobuf-lite:3.0.1)
Duplicate class com.google.protobuf.ExtensionLite found in modules jetified-protobuf-javalite-3.13.0.jar (com.google.protobuf:protobuf-javalite:3.13.0) and jetified-protobuf-lite-3.0.1.jar (com.google.protobuf:protobuf-lite:3.0.1)
Duplicate class com.google.protobuf.ExtensionRegistryFactory found in modules jetified-protobuf-javalite-3.13.0.jar (com.google.protobuf:protobuf-javalite:3.13.0) and jetified-protobuf-lite-3.0.1.jar (com.google.protobuf:protobuf-lite:3.0.1)
Duplicate class com.google.protobuf.ExtensionRegistryLite found in modules jetified-protobuf-javalite-3.13.0.jar (com.google.protobuf:protobuf-javalite:3.13.0) and jetified-protobuf-lite-3.0.1.jar (com.google.protobuf:protobuf-lite:3.0.1)
Duplicate class com.google.protobuf.ExtensionRegistryLite$ObjectIntPair found in modules jetified-protobuf-javalite-3.13.0.jar (com.google.protobuf:protobuf-javalite:3.13.0) and jetified-protobuf-lite-3.0.1.jar (com.google.protobuf:protobuf-lite:3.0.1)
Steps to reproduce the behavior:
1.Create flutter sample app
firebase_remote_config: ^0.4.0+2 to pubspec.yaml./gradlew dependencies :app:dependencies in app dirI would expected the plugin to use the current Firebase BOM dependencies.
Output ./gradlew dependencies :app:dependencies
Click To Expand
+--- project :firebase_remote_config
| +--- project :firebase_core
| | +--- io.flutter:flutter_embedding_debug:1.0.0-5babba6c4d25fa237bbf755ab85c9a0c50b3c6ec (*)
| | +--- com.google.firebase:firebase-bom:25.3.1
| | | +--- com.google.firebase:firebase-config:19.1.4 (c)
| | | +--- com.google.firebase:firebase-core:17.4.1 (c)
| | | \--- com.google.firebase:firebase-analytics:17.4.1 (c)
| | +--- com.google.firebase:firebase-core -> 17.4.1
| | | \--- com.google.firebase:firebase-analytics:17.4.1
| | | +--- com.google.android.gms:play-services-measurement:17.4.1
| | | | +--- androidx.collection:collection:1.0.0 -> 1.1.0 (*)
| | | | +--- androidx.legacy:legacy-support-core-utils:1.0.0
| | | | | +--- androidx.annotation:annotation:1.0.0 -> 1.1.0
| | | | | +--- androidx.core:core:1.0.0 -> 1.1.0 (*)
| | | | | +--- androidx.documentfile:documentfile:1.0.0
| | | | | | \--- androidx.annotation:annotation:1.0.0 -> 1.1.0
| | | | | +--- androidx.loader:loader:1.0.0 (*)
| | | | | +--- androidx.localbroadcastmanager:localbroadcastmanager:1.0.0
| | | | | | \--- androidx.annotation:annotation:1.0.0 -> 1.1.0
| | | | | \--- androidx.print:print:1.0.0
| | | | | \--- androidx.annotation:annotation:1.0.0 -> 1.1.0
| | | | +--- com.google.android.gms:play-services-basement:17.0.0
| | | | | +--- androidx.collection:collection:1.0.0 -> 1.1.0 (*)
| | | | | +--- androidx.core:core:1.0.0 -> 1.1.0 (*)
| | | | | \--- androidx.fragment:fragment:1.0.0 -> 1.1.0 (*)
| | | | +--- com.google.android.gms:play-services-measurement-base:[17.4.1] -> 17.4.1
| | | | | \--- com.google.android.gms:play-services-basement:17.0.0 (*)
| | | | +--- com.google.android.gms:play-services-measurement-impl:[17.4.1] -> 17.4.1
| | | | | +--- androidx.collection:collection:1.0.0 -> 1.1.0 (*)
| | | | | +--- androidx.core:core:1.0.0 -> 1.1.0 (*)
| | | | | +--- com.google.android.gms:play-services-ads-identifier:17.0.0
| | | | | | \--- com.google.android.gms:play-services-basement:17.0.0 (*)
| | | | | +--- com.google.android.gms:play-services-basement:17.0.0 (*)
| | | | | +--- com.google.android.gms:play-services-measurement-base:[17.4.1] -> 17.4.1 (*)
| | | | | \--- com.google.android.gms:play-services-stats:17.0.0
| | | | | +--- androidx.legacy:legacy-support-core-utils:1.0.0 (*)
| | | | | \--- com.google.android.gms:play-services-basement:17.0.0 (*)
| | | | \--- com.google.android.gms:play-services-stats:17.0.0 (*)
| | | +--- com.google.android.gms:play-services-measurement-api:17.4.1
| | | | +--- com.google.android.gms:play-services-basement:17.0.0 (*)
| | | | +--- com.google.android.gms:play-services-measurement-base:[17.4.1] -> 17.4.1 (*)
| | | | +--- com.google.android.gms:play-services-measurement-impl:[17.4.1] -> 17.4.1 (*)
| | | | +--- com.google.android.gms:play-services-measurement-sdk-api:[17.4.1] -> 17.4.1
| | | | | +--- com.google.android.gms:play-services-basement:17.0.0 (*)
| | | | | \--- com.google.android.gms:play-services-measurement-base:[17.4.1] -> 17.4.1 (*)
| | | | +--- com.google.android.gms:play-services-tasks:17.0.0
| | | | | \--- com.google.android.gms:play-services-basement:17.0.0 (*)
| | | | +--- com.google.firebase:firebase-common:19.3.0
| | | | | +--- com.google.android.gms:play-services-basement:17.0.0 (*)
| | | | | +--- com.google.android.gms:play-services-tasks:17.0.0 (*)
| | | | | +--- com.google.auto.value:auto-value-annotations:1.6.5
| | | | | \--- com.google.firebase:firebase-components:16.0.0
| | | | | \--- androidx.annotation:annotation:1.1.0
| | | | +--- com.google.firebase:firebase-components:16.0.0 (*)
| | | | +--- com.google.firebase:firebase-iid:20.1.5
| | | | | +--- androidx.collection:collection:1.0.0 -> 1.1.0 (*)
| | | | | +--- androidx.core:core:1.0.0 -> 1.1.0 (*)
| | | | | +--- androidx.legacy:legacy-support-core-utils:1.0.0 (*)
| | | | | +--- com.google.android.gms:play-services-basement:17.0.0 (*)
| | | | | +--- com.google.android.gms:play-services-stats:17.0.0 (*)
| | | | | +--- com.google.android.gms:play-services-tasks:17.0.0 (*)
| | | | | +--- com.google.firebase:firebase-common:19.3.0 (*)
| | | | | +--- com.google.firebase:firebase-components:16.0.0 (*)
| | | | | +--- com.google.firebase:firebase-iid-interop:17.0.0
| | | | | | +--- com.google.android.gms:play-services-base:17.0.0
| | | | | | | +--- androidx.collection:collection:1.0.0 -> 1.1.0 (*)
| | | | | | | +--- androidx.core:core:1.0.0 -> 1.1.0 (*)
| | | | | | | +--- androidx.fragment:fragment:1.0.0 -> 1.1.0 (*)
| | | | | | | +--- com.google.android.gms:play-services-basement:17.0.0 (*)
| | | | | | | \--- com.google.android.gms:play-services-tasks:17.0.0 (*)
| | | | | | \--- com.google.android.gms:play-services-basement:17.0.0 (*)
| | | | | +--- com.google.firebase:firebase-installations:16.2.1
| | | | | | +--- com.google.android.gms:play-services-tasks:17.0.0 (*)
| | | | | | +--- com.google.firebase:firebase-common:19.3.0 (*)
| | | | | | +--- com.google.firebase:firebase-components:16.0.0 (*)
| | | | | | \--- com.google.firebase:firebase-installations-interop:16.0.0
| | | | | | \--- com.google.android.gms:play-services-tasks:17.0.0 (*)
| | | | | \--- com.google.firebase:firebase-installations-interop:16.0.0 (*)
| | | | \--- com.google.firebase:firebase-measurement-connector:18.0.0
| | | | \--- com.google.android.gms:play-services-basement:17.0.0 (*)
| | | \--- com.google.android.gms:play-services-measurement-sdk:17.4.1
| | | +--- androidx.collection:collection:1.0.0 -> 1.1.0 (*)
| | | +--- com.google.android.gms:play-services-basement:17.0.0 (*)
| | | +--- com.google.android.gms:play-services-measurement-base:[17.4.1] -> 17.4.1 (*)
| | | \--- com.google.android.gms:play-services-measurement-impl:[17.4.1] -> 17.4.1 (*)
| | \--- androidx.annotation:annotation:1.1.0
| +--- io.flutter:flutter_embedding_debug:1.0.0-5babba6c4d25fa237bbf755ab85c9a0c50b3c6ec (*)
| +--- com.google.firebase:firebase-bom:25.3.1 (*)
| +--- com.google.firebase:firebase-config -> 19.1.4
| | +--- com.google.firebase:firebase-abt:19.0.1
| | | +--- com.google.android.gms:play-services-basement:17.0.0 (*)
| | | +--- com.google.firebase:firebase-common:19.3.0 (*)
| | | +--- com.google.firebase:firebase-components:16.0.0 (*)
| | | +--- com.google.firebase:firebase-measurement-connector:18.0.0 (*)
| | | \--- com.google.protobuf:protobuf-lite:3.0.1
| | +--- com.google.firebase:firebase-common:19.3.0 (*)
| | +--- com.google.firebase:firebase-components:16.0.0 (*)
| | +--- com.google.firebase:firebase-iid:20.1.5 (*)
| | +--- com.google.firebase:firebase-measurement-connector:18.0.0 (*)
| | \--- com.google.protobuf:protobuf-lite:3.0.1
| \--- androidx.annotation:annotation:1.1.0
\--- project :firebase_core (*)
Run flutter doctor and paste the output below:
Click To Expand
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel unknown, 1.22.0, on Mac OS X 10.15.6 19G2021, locale en-NL)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 11.6)
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.0)
[✓] IntelliJ IDEA Community Edition (version 2019.3.5)
[✓] VS Code (version 1.49.3)
Run flutter pub deps -- --style=compact and paste the output below:
Click To Expand
```
Dart SDK 2.10.0
Flutter SDK 1.22.0
firebase_repo 1.0.0+1
dependencies:
dev dependencies:
transitive dependencies:
I do see an older version of protobuf for remote_config and firebase_core. I am on latest stable.


flutter doctor -v
[✓] Flutter (Channel stable, 1.22.1, on Mac OS X 10.15.4 19E2269, locale en-IN)
• Flutter version 1.22.1 at /Users/dhs/documents/Fluttersdk/flutter
• Framework revision f30b7f4db9 (5 days ago), 2020-10-08 10:06:30 -0700
• Engine revision 75bef9f6c8
• Dart version 2.10.1
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
• Android SDK at /Users/dhs/Library/Android/sdk
• Platform android-30, build-tools 30.0.0
• Java binary at: /Applications/Android
Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build
1.8.0_242-release-1644-b3-6222593)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 12.0.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.0.1, Build version 12A7300
• CocoaPods version 1.9.3
[✓] Android Studio (version 4.0)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 46.0.2
• Dart plugin version 193.7361
• Java version OpenJDK Runtime Environment (build
1.8.0_242-release-1644-b3-6222593)
[✓] VS Code (version 1.49.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.11.0
[✓] Connected device (1 available)
• iPhone SE (2nd generation) (mobile) • 6C85835D-FBFD-4AB3-8DE8-B4FAD35E5367
• ios • com.apple.CoreSimulator.SimRuntime.iOS-14-0 (simulator)
• No issues found!
I am having the exact same issue. Is there a workaround for this now?
I found a possible workaround that works for me. Add this to the build.gradle of your app.
subprojects {
project.evaluationDependsOn(':app')
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.google.protobuf'
&& details.requested.name.contains('protobuf-lite') ) {
details.useTarget group: details.requested.group, name: 'protobuf-javalite', version:'3.13.0'
}
}
}
}
Thanks for the solution @remonh87.
Closing for now, unless anything else is needed.
@dackers86 I still would like to see that the protobuf will be upgraded. For our library Reactive ble we were forced to downgrade the protobuf version because of collisions with firebase remote config.
I found a possible workaround that works for me. Add this to the build.gradle of your app.
subprojects { project.evaluationDependsOn(':app') project.configurations.all { resolutionStrategy.eachDependency { details -> if (details.requested.group == 'com.google.protobuf' && details.requested.name.contains('protobuf-lite') ) { details.useTarget group: details.requested.group, name: 'protobuf-javalite', version:'3.13.0' } } } }
This workaround doesn't work in my case because it conflicts with another project (barcode_reader). Please don't close this issue until it's resolved since I can't use this project currently at all.
Most helpful comment
I found a possible workaround that works for me. Add this to the build.gradle of your app.