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

Error after adding boofcv-core to Android: java.lang.RuntimeException: Duplicate class com.google.protobuf #26

Open
SherMish opened this issue Nov 8, 2022 · 2 comments

Comments

@SherMish
Copy link

SherMish commented Nov 8, 2022

I'm trying to add boofcv-core library to my Android project. boofcv-android works fine but boofcv-core generates the following error: java.lang.RuntimeException: Duplicate class com.google.protobuf.AbstractMessageLite found in modules protobuf-java-3.17.3.jar (com.google.protobuf:protobuf-java:3.17.3) and protobuf-javalite-3.14.0.jar (com.google.protobuf:protobuf-javalite:3.14.0)...

com.google.firebase:firebase-config uses protobuf-javalite and I can`t remove that library from the project.

The code at build.gradle:

...
configurations {
//    compile.exclude group: 'com.google.protobuf' // when uncommented, causes other errors
    all*.exclude group: "xmlpull", module: "xmlpull"
    all*.exclude group: "org.apache.commons", module: "commons-compress"
    all*.exclude group: "com.thoughtworks.xstream", module: "commons-compress"
}

dependencies {
    ['boofcv-android', 'boofcv-core'].each {
        String a -> implementation group: 'org.boofcv', name: a, version: '0.37'
    }
...
@SherMish
Copy link
Author

SherMish commented Nov 8, 2022

@lessthanoptimal
Copy link
Owner

Left a comment on stack, but you would probably be better off excluding the transitive dependency when calling implementation. Worried you might be including two versions of protobuf, but avoiding a compile time error.

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

2 participants