Solution 1 :
You may find this stackoverflow post helpful to understand the dependency tree.
the syntax you are using does not match what most documents state : 2 3 4.
your syntax :
implementation('com.google.firebase:firebase-firestore:20.0.0') {
exclude module: 'gson'
exclude module: 'com.google.gauva:gauva-jdk5:17.0'
}
As mentioned in blog:
configurations.implementation { exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging' }
As mentioned in Thread:
implementation ('com.google.apis:google-api-services-youtube:v3-rev183-1.22.0') { exclude group: 'org.apache.httpcomponents' exclude group:'com.google.guava' }
As mentioned in Thread:
configurations.implementation.exclude(group: 'com.google.firebase', module: 'protolite-well-known-types')
Try changing the configuration syntax to get the desired results
configurations.implementation {
exclude group: 'com.google.gauva', module: 'gauva-jdk5'
}
or
configurations.implementation.exclude(group: 'com.google.gauva', module: 'gauva-jdk5')
Problem :
I have been using realtime Firebase for my app for some time .I need to add Firestore to my project . when adding firestore , I have a duplication error . I would like to exclude modules from firestore and not from other libs .
I can not identify which module should be removed besides gson that was also duplicated.
implementation(‘com.google.firebase:firebase-firestore:24.1.2’){
exclude module: ‘gson’,
exclude module:????
}
It seems very close or a duplicate of some other questions but none of the given answsers in previous questions worked
I can not give all gradle because file is very large but main google elements are :
implementation 'com.google.firebase:firebase-database:20.0.0'
implementation 'com.google.firebase:firebase-auth:20.0.0'
implementation 'com.google.firebase:firebase-core:20.0.0'
implementation 'com.google.firebase:firebase-functions:20.0.0'
implementation 'com.google.firebase:firebase-storage:20.0.0'
implementation 'com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava'
implementation('com.google.firebase:firebase-firestore:20.0.0') {
exclude module: 'gson'
exclude module: 'com.google.gauva:gauva-jdk5:17.0'
}
implementation 'com.google.api-client:google-api-client-android:1.23.0' exclude module: 'httpclient' exclude module: 'com.google.gauva:gauva-jdk5:17.0'
I supppose issue comes from
implementation files(‘libsdeeparteffects-android-client-1.0.0-jar-with-dependencies.jar’) but i can not really test it
Duplicate class com.google.common.util.concurrent.WrappingExecutorService found in modules jetified-guava-30.1.1-android (com.google.guava:guava:30.1.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.util.concurrent.WrappingExecutorService$1 found in modules jetified-guava-30.1.1-android (com.google.guava:guava:30.1.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.util.concurrent.WrappingScheduledExecutorService found in modules jetified-guava-30.1.1-android (com.google.guava:guava:30.1.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.util.concurrent.package-info found in modules jetified-guava-30.1.1-android (com.google.guava:guava:30.1.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.xml.XmlEscapers found in modules jetified-guava-30.1.1-android (com.google.guava:guava:30.1.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.xml.package-info found in modules jetified-guava-30.1.1-android (com.google.guava:guava:30.1.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.thirdparty.publicsuffix.PublicSuffixPatterns found in modules jetified-guava-30.1.1-android (com.google.guava:guava:30.1.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.thirdparty.publicsuffix.PublicSuffixType found in modules jetified-guava-30.1.1-android (com.google.guava:guava:30.1.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.thirdparty.publicsuffix.TrieParser found in modules jetified-guava-30.1.1-android (com.google.guava:guava:30.1.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Comments
Comment posted by Duplicate class com.google.common.util.concurrent.ListenableFuture found in modules guava-20.0.jar (com.google.guava:guava:20.0)
Does this answer your question?
Comment posted by it75
Thanx, i tried both answers given for this questions and none worked . Weird to have this issue just with firestore and not realtime firebase
Comment posted by stackoverflow.com/a/61982002/15774176
can you share your build.gradle file and check for the link :
Comment posted by it75
Hi, issue seems very similar but just adding elements in the configurations part makes the build fail .I don t which causes duplication issues, i supsect an external modul deepart, but i can not confirm . i can not exclude anything from this module i guess
Comment posted by Divyani Yadav
is this issue resolved by exclusion ?
Comment posted by it75
It was not too clear for me what it really changed but anyway i tried all combinaisons and none worked
Comment posted by Divyani Yadav
is still the log showing same?
Comment posted by it75
All the tests give different errors but basically there are duplicate elements issues