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 3.20 duplicate classes with protobuf-java #9902

Closed
maikelvdh opened this issue May 3, 2022 · 2 comments
Closed

protobuf-kotlin 3.20 duplicate classes with protobuf-java #9902

maikelvdh opened this issue May 3, 2022 · 2 comments
Assignees
Labels

Comments

@maikelvdh
Copy link

What version of protobuf and what language are you using?
Version: 3.20.0
Language: Kotlin

What operating system (Linux, Windows, ...) and version?
macOS 12.2.1

What runtime / compiler are you using (e.g., python version or gcc version)
Protoc 3.20.0
Gradle 7.4.2

What did you do?
Steps to reproduce the behavior:

1. Create a new Android studio project
2. Add dependency on com.google.protobuf:protobuf-kotlin:3.20.0
3. Build project
4. See error

What did you expect to see
Project builds successfully

What did you see instead?
Gradle outputs the following set of errors (reduced the size):

Duplicate class com.google.protobuf.Any found in modules protobuf-java-3.20.0 (com.google.protobuf:protobuf-java:3.20.0) and protobuf-kotlin-3.20.0 (com.google.protobuf:protobuf-kotlin:3.20.0)
Duplicate class com.google.protobuf.Any$1 found in modules protobuf-java-3.20.0 (com.google.protobuf:protobuf-java:3.20.0) and protobuf-kotlin-3.20.0 (com.google.protobuf:protobuf-kotlin:3.20.0)
Duplicate class com.google.protobuf.Any$Builder found in modules protobuf-java-3.20.0 (com.google.protobuf:protobuf-java:3.20.0) and protobuf-kotlin-3.20.0 (com.google.protobuf:protobuf-kotlin:3.20.0)
Duplicate class com.google.protobuf.AnyOrBuilder found in modules protobuf-java-3.20.0 (com.google.protobuf:protobuf-java:3.20.0) and protobuf-kotlin-3.20.0 (com.google.protobuf:protobuf-kotlin:3.20.0)
Duplicate class com.google.protobuf.AnyProto found in modules protobuf-java-3.20.0 (com.google.protobuf:protobuf-java:3.20.0) and protobuf-kotlin-3.20.0 (com.google.protobuf:protobuf-kotlin:3.20.0)
Duplicate class com.google.protobuf.Api found in modules protobuf-java-3.20.0 (com.google.protobuf:protobuf-java:3.20.0) and protobuf-kotlin-3.20.0 (com.google.protobuf:protobuf-kotlin:3.20.0)
Duplicate class com.google.protobuf.Api$1 found in modules protobuf-java-3.20.0 (com.google.protobuf:protobuf-java:3.20.0) and protobuf-kotlin-3.20.0 (com.google.protobuf:protobuf-kotlin:3.20.0)
Duplicate class com.google.protobuf.Api$Builder found in modules protobuf-java-3.20.0 (com.google.protobuf:protobuf-java:3.20.0) and protobuf-kotlin-3.20.0 (com.google.protobuf:protobuf-kotlin:3.20.0)
Duplicate class com.google.protobuf.ApiOrBuilder found in modules protobuf-java-3.20.0 (com.google.protobuf:protobuf-java:3.20.0) and protobuf-kotlin-3.20.0 (com.google.protobuf:protobuf-kotlin:3.20.0)
Duplicate class com.google.protobuf.ApiProto found in modules protobuf-java-3.20.0 (com.google.protobuf:protobuf-java:3.20.0) and protobuf-kotlin-3.20.0 (com.google.protobuf:protobuf-kotlin:3.20.0)
Duplicate class com.google.protobuf.BoolValue found in modules protobuf-java-3.20.0 (com.google.protobuf:protobuf-java:3.20.0) and protobuf-kotlin-3.20.0 (com.google.protobuf:protobuf-kotlin:3.20.0)
Duplicate class com.google.protobuf.BoolValue$1 found in modules protobuf-java-3.20.0 (com.google.protobuf:protobuf-java:3.20.0) and protobuf-kotlin-3.20.0 (com.google.protobuf:protobuf-kotlin:3.20.0)

As the error suggests, this is caused because both protobuf-kotlin and protobuf-java include the same generated sources from proto files. This seems to be introduced with following change: a32a2a3

@deannagarcia deannagarcia self-assigned this May 3, 2022
@deannagarcia
Copy link
Member

Thanks for this report! Working on a PR to fix it now.

@deannagarcia
Copy link
Member

Should be fixed by #9909, let me know if you still see this problem.

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

No branches or pull requests

2 participants