-
Notifications
You must be signed in to change notification settings - Fork 15.6k
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
Kotlin library cause duplicate classes error #8631
Comments
Thanks for this report! I will look into how to fix this on our side to stop the errors, but I think this should be fixable on the user's side in the meantime by only using |
Can you provide more information about your build system and how we could reproduce this error? |
Normal Android App project,build.gradle as below:
|
When you look into And when you check the source code of protobuf-kotlin-3.17.0.jar, you will find that code of |
Yeah |
What version of gradle are you using? |
I have create a new repo to reproduce this error. Please try to clone and build the repo below: https://github.com/kyze8439690/KotlinProtobufReproduce |
Complete error log as below:
|
I am getting the same error on Android. I can, also, see what is described, eg. |
@fowles I am using Gradle 7.0 |
Thanks for the example! I've been able to reproduce this error but I'm still looking into a fix. |
I assume this will be present in the next release after In the meantime the below seems to work for me.
|
Yep! Working on the fix and a point release for it. Thanks for sharing this workaround! |
I think this should be fixed in 3.17.3! |
@deannagarcia This bug seems to be back in |
Sorry about this getting back in, I think I fixed it in response to #9902 so it should be fixed in the next release. |
Still breaking in the latest release @deannagarcia
|
This is a different problem. The classes are clashing because you are using both the |
What version of protobuf and what language are you using?
Version: 3.17.0
Language: Kotlin
What operating system (Linux, Windows, ...) and version?
Android
What runtime / compiler are you using (e.g., python version or gcc version)
target sdk version 30
What did you do?
implementation 'com.google.protobuf:protobuf-kotlin:3.17.0'
It seems that
protobuf-kotlin
will implementprotobuf-java
also, but they have a lot of duplicate classes. Code below will solve the problem:The text was updated successfully, but these errors were encountered: