duplicate file protobuf-java-3.21.12

73 Views Asked by At

I am implementing the tomtom maps in my android project but when implementing implementation "com.tomtom.sdk.maps:map-display:0.3.1617" It tells me that there is a conflict with the file protobuf-java-3.21.12 that are duplicates,I can't find another solution than to try to do it with other types of maps but first I want to know if there is a solution to this problem. This would be part of the error.

Execution failed for task ':app:checkQaDebugDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
   > Duplicate class com.google.protobuf.AbstractMessageLite found in modules protobuf-java-3.21.12 (com.google.protobuf:protobuf-java:3.21.12) and protobuf-javalite-3.17.3 (com.google.protobuf:protobuf-javalite:3.17.3)
     Duplicate class com.google.protobuf.AbstractMessageLite$Builder found in modules protobuf-java-3.21.12 (com.google.protobuf:protobuf-java:3.21.12) and protobuf-javalite-3.17.3 (com.google.protobuf:protobuf-javalite:3.17.3)
     Duplicate class com.google.protobuf.AbstractMessageLite$Builder$LimitedInputStream found in modules protobuf-java-3.21.12 (com.google.protobuf:protobuf-java:3.21.12) and protobuf-javalite-3.17.3 (com.google.protobuf:protobuf-javalite:3.17.3)
     Duplicate class com.google.protobuf.AbstractMessageLite$InternalOneOfEnum found in modules protobuf-java-3.21.12 (com.google.protobuf:protobuf-java:3.21.12) and protobuf-javalite-3.17.3 (com.google.protobuf:protobuf-javalite:3.17.3)
     Duplicate class com.google.protobuf.AbstractParser found in modules protobuf-java-3.21.12 (com.google.protobuf:protobuf-java:3.21.12) and protobuf-javalite-3.17.3 (com.google.protobuf:protobuf-javalite:3.17.3)
     Duplicate class com.google.protobuf.AbstractProtobufList found in modules protobuf-java-3.21.12 (com.google.protobuf:protobuf-java:3.21.12) and protobuf-javalite-3.17.3 (com.google.protobuf:protobuf-javalite:3.17.3)
     Duplicate class com.google.protobuf.AllocatedBuffer found in modules protobuf-java-3.21.12 (com.google.protobuf:protobuf-java:3.21.12) and protobuf-javalite-3.17.3 (com.google.protobuf:protobuf-javalite:3.17.3)
     Duplicate class com.google.protobuf.AllocatedBuffer$1 found in modules protobuf-java-3.21.12 (com.google.protobuf:protobuf-java:3.21.12) and protobuf-javalite-3.17.3 (com.google.protobuf:protobuf-javalite:3.17.3)
     Duplicate class com.google.protobuf.AllocatedBuffer$2 found in modules protobuf-java-3.21.12 (com.google.protobuf:protobuf-java:3.21.12) and protobuf-javalite-3.17.3 (com.google.protobuf:protobuf-javalite:3.17.3)

I found that downloading the firebase version but I had no success

1

There are 1 best solutions below

0
On

I was able to resolve this issue by adding my dependencies like this:

implementation ('com.tomtom.sdk.maps:map-display:0.46.0', { 
    exclude group: 'com.google.protobuf', module:'proto-google-common-protos'
    exclude group: 'com.google.protobuf', module:'protolite-well-known-types'
    exclude group: 'com.google.protobuf', module:'protobuf-javalite'
    exclude group: 'com.google.protobuf', module:'protobuf-lite'
    exclude group: 'com.google.protobuf', module:'protobuf-java'
    exclude group: 'com.google.protobuf', module:'protobuf-kotlin'})

In fact I had to do it with all of the TomTom dependencies. So if you have more add them in there like this to your build.gradle(:app) file.

From what I could tell these two dependencies were causing the duplicate class issues. But it is possible that you have other dependencies causing this issue.

implementation 'com.github.imperiumlabs:GeoFirestore-Android:v1.5.0' // this one duplicate class issue
implementation 'com.google.firebase:firebase-firestore-ktx' // this one duplicate class issue.