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

Protobuf kotlin & java 3.25.0-1 :app:mergeDebugJavaResource and ':app:checkDebugDuplicateClasses failing #14830

Closed
bitsydarel opened this issue Nov 22, 2023 · 2 comments
Assignees

Comments

@bitsydarel
Copy link

What version of protobuf and what language are you using?
Version: 3.25.1
Language: Kotlin/Java

What operating system (Linux, Windows, ...) and version?
MacOs Sonama

What did you do?
Steps to reproduce the behavior:
add firebase performance android and other firebase android dependencies.
add protobuf kotlin 3.25.1 to android project

What did you expect to see
The build to pass successfully

What did you see 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 jetified-protobuf-java-3.25.1 (com.google.protobuf:protobuf-java:3.25.1) and jetified-protobuf-javalite-3.25.1 (com.google.protobuf:protobuf-javalite:3.25.1)
Duplicate class com.google.protobuf.AbstractMessageLite$Builder found in modules jetified-protobuf-java-3.25.1 (com.google.protobuf:protobuf-java:3.25.1) and jetified-protobuf-javalite-3.25.1 (com.google.protobuf:protobuf-javalite:3.25.1)
Duplicate class com.google.protobuf.AbstractMessageLite$Builder$LimitedInputStream found in modules jetified-protobuf-java-3.25.1 (com.google.protobuf:protobuf-java:3.25.1) and jetified-protobuf-javalite-3.25.1 (com.google.protobuf:protobuf-javalite:3.25.1)
Duplicate class com.google.protobuf.AbstractMessageLite$InternalOneOfEnum found in modules jetified-protobuf-java-3.25.1 (com.google.protobuf:protobuf-java:3.25.1) and jetified-protobuf-javalite-3.25.1 (com.google.protobuf:protobuf-javalite:3.25.1)
Duplicate class com.google.protobuf.AbstractParser found in modules jetified-protobuf-java-3.25.1 (

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
==============================================================================

2: Task failed with an exception.

  • What went wrong:
    Execution failed for task ':app:mergeDebugJavaResource'.

A failure occurred while executing com.android.build.gradle.internal.tasks.MergeJavaResWorkAction
2 files found with path 'google/protobuf/field_mask.proto' from inputs:
- /Users/darelbitsy/.gradle/caches/transforms-3/0387c1ad77dd8e2f282b0fedf00b2f1b/transformed/jetified-protobuf-java-3.25.1.jar
- /Users/darelbitsy/.gradle/caches/transforms-3/82c259190a83ccdbe0daaef6ddc63c23/transformed/jetified-protobuf-javalite-3.25.1.jar
Adding a packagingOptions block may help, please refer to
https://developer.android.com/reference/tools/gradle-api/8.1/com/android/build/api/dsl/ResourcesPackagingOptions
for more information

Anything else we should know about your project / environment
It's a flutter project

@bitsydarel bitsydarel added the untriaged auto added to all issues by default when created. label Nov 22, 2023
@shaod2 shaod2 added java kotlin and removed untriaged auto added to all issues by default when created. labels Nov 22, 2023
@bitsydarel
Copy link
Author

updated all of our local plugin to use javalite solved the issue, basically using protobuf-kotlin include protobuf-java

@king-11
Copy link

king-11 commented Jan 30, 2024

@bitsydarel which version of protoc are you using I am not able to generate code for 3.25.1 using my protoc version 25.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants