Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to add dependency because build error caused by conflict with com.google.protobuf:protobuf-javalite #25

Open
marcardar opened this issue Nov 24, 2024 · 0 comments

Comments

@marcardar
Copy link

The Android dependency has a dependency on com.google.protobuf:protobuf-java and so results in a build error when the app also has a dependency on com.google.protobuf:protobuf-javalite (such as firestore). I can't find a way to workaround this.

Apps cannot depend on both of those dependencies.

I've tried various proposed solutions such as excluding protobuf-javalite dependency from the firestore dependency (this gives a VerifyError) and excluding protobuf-java from my app dependency, but nothing works. I've also tried forcing the version of protobuf-java or protobuf-javalite.

This is essentially blocking me from using libsql in my app. Can libsql depend on com.google.protobuf:protobuf-javalite instead?

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
   > Duplicate class com.google.protobuf.AbstractMessageLite found in modules protobuf-java-3.24.0.jar -> protobuf-java-3.24.0 (com.google.protobuf:protobuf-java:3.24.0) and protobuf-javalite-3.25.1.jar -> protobuf-javalite-3.25.1 (com.google.protobuf:protobuf-javalite:3.25.1)
     Duplicate class com.google.protobuf.AbstractMessageLite$Builder found in modules protobuf-java-3.24.0.jar -> protobuf-java-3.24.0 (com.google.protobuf:protobuf-java:3.24.0) and protobuf-javalite-3.25.1.jar -> protobuf-javalite-3.25.1 (com.google.protobuf:protobuf-javalite:3.25.1)
     Duplicate class com.google.protobuf.AbstractMessageLite$Builder$LimitedInputStream found in modules protobuf-java-3.24.0.jar -> protobuf-java-3.24.0 (com.google.protobuf:protobuf-java:3.24.0) and protobuf-javalite-3.25.1.jar -> protobuf-javalite-3.25.1 (com.google.protobuf:protobuf-javalite:3.25.1)
     Duplicate class com.google.protobuf.AbstractMessageLite$InternalOneOfEnum found in modules protobuf-java-3.24.0.jar -> protobuf-java-3.24.0 (com.google.protobuf:protobuf-java:3.24.0) and protobuf-javalite-3.25.1.jar -> protobuf-javalite-3.25.1 (com.google.protobuf:protobuf-javalite:3.25.1)
     Duplicate class com.google.protobuf.AbstractParser found in modules protobuf-java-3.24.0.jar -> protobuf-java-3.24.0 (com.google.protobuf:protobuf-java:3.24.0) and protobuf-javalite-3.25.1.jar -> protobuf-javalite-3.25.1 (com.google.protobuf:protobuf-javalite:3.25.1)
     Duplicate class com.google.protobuf.AbstractProtobufList found in modules protobuf-java-3.24.0.jar -> protobuf-java-3.24.0 (com.google.protobuf:protobuf-java:3.24.0) and protobuf-javalite-3.25.1.jar -> protobuf-javalite-3.25.1 (com.google.protobuf:protobuf-javalite:3.25.1)
     Duplicate class com.google.protobuf.AllocatedBuffer found in modules protobuf-java-3.24.0.jar -> protobuf-java-3.24.0 (com.google.protobuf:protobuf-java:3.24.0) and protobuf-javalite-3.25.1.jar -> protobuf-javalite-3.25.1 (com.google.protobuf:protobuf-javalite:3.25.1)
...(loads more lines like this)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant