BoofCV icon indicating copy to clipboard operation
BoofCV copied to clipboard

In Android, Conflict between protobuf-java and protobuf-javalite.

Open seankim1311 opened this issue 2 years ago • 4 comments

Hi, when I add a dependency to build.gradle on Android, the following error appears:

Duplicate class com.google.protobuf.Writer found in modules jetified-protobuf-java-3.17.3 (com.google.protobuf:protobuf-java:3.17.3) and jetified-protobuf-javalite-3.11.4 (com.google.protobuf:protobuf-javalite:3.11.4) Duplicate class com.google.protobuf.Writer$FieldOrder found in modules jetified-protobuf-java-3.17.3 (com.google.protobuf:protobuf-java:3.17.3) and jetified-protobuf-javalite-3.11.4 (com.google.protobuf:protobuf-javalite:3.11.4)

This seems like a problem with Protobuf, but can I get another version or special detour to avoid this problem in boofcv?

seankim1311 avatar Aug 22 '22 10:08 seankim1311

Will adding an exclusion help resolve this conflict? Here's an example from a build.gradle with Groovy DSL

configurations {
    all*.exclude group: "xmlpull", module: "xmlpull"
    all*.exclude group: "org.apache.commons", module: "commons-compress"
    all*.exclude group: "com.thoughtworks.xstream", module: "commons-compress"
}

lessthanoptimal avatar Aug 30 '22 18:08 lessthanoptimal

Will adding an exclusion help resolve this conflict? Here's an example from a build.gradle with Groovy DSL

configurations {
    all*.exclude group: "xmlpull", module: "xmlpull"
    all*.exclude group: "org.apache.commons", module: "commons-compress"
    all*.exclude group: "com.thoughtworks.xstream", module: "commons-compress"
}

I'm having the same issue. Adding the inclusion lines doesn't seem to help. @seankim1311 Did you solve the problem?

SherMish avatar Nov 08 '22 10:11 SherMish

@lessthanoptimal we also have this issue. We can't integrate Firebase and BOOFCV in the same project.

zvibazak avatar Nov 08 '22 10:11 zvibazak

@zvibazak and @seankim1311 can someone share a simple project that I can replicate the issue with? I think @SherMish has a work around, but worried it might be hiding an issue where conflicting jars are included at runtime.

lessthanoptimal avatar Nov 08 '22 15:11 lessthanoptimal