This are dependencies I added:
dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.google.android.material:material:1.4.0-alpha02'
implementation 'com.google.firebase:firebase-auth:20.0.4'
implementation 'androidx.gridlayout:gridlayout:1.0.0'
implementation 'com.google.firebase:firebase-firestore:22.1.2'
implementation 'com.google.firebase:firebase-core:15.0.2'
testImplementation 'junit:junit:4.13.2'
implementation 'com.github.VishnuSivadasVS:Advanced-HttpURLConnection:1.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'com.google.android.gms:play-services-base:11.8.0'
implementation 'com.google.android.gms:play-services-auth:11.8.0'
implementation 'com.google.apis:google-api-services-vision:v1-rev357-1.22.0'
implementation 'com.google.code.findbugs:jsr305:3.0.2'
implementation 'commons-io:commons-io:2.5'
implementation 'com.google.api-client:google-api-client-android:1.22.0'
implementation 'com.google.http-client:google-http-client-gson:1.20.0'
}
and I got this error but it works good in another project may be it due to dependency please help
Execution failed for task ':app:checkDebugDuplicateClasses'.
A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
Duplicate class com.google.common.annotations.Beta found in modules jetified-guava-28.1-android (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.annotations.GwtCompatible found in modules jetified-guava-28.1-android (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.annotations.GwtIncompatible found in modules jetified-guava-28.1-android (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.annotations.VisibleForTesting found in modules jetified-guava-28.1-android (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.base.Absent found in modules jetified-guava-28.1-android (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.base.AbstractIterator found in modules jetified-guava-28.1-android (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.base.AbstractIterator$1 found in modules jetified-guava-28.1-android (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.base.AbstractIterator$State found in modules jetified-guava-28.1-android (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.base.Ascii found in modules jetified-guava-28.1-android (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.base.CaseFormat found in modules jetified-guava-28.1-android (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.base.CaseFormat$1 found in modules jetified-guava-28.1-android (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.base.CaseFormat$2 found in modules jetified-guava-28.1-android (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.base.CaseFormat$3 found in modules jetified-guava-28.1-android (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.base.CaseFormat$4 found in modules jetified-guava-28.1-android (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.base.CaseFormat$5 found in modules jetified-guava-28.1-android (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.base.CaseFormat$StringConverter found in modules jetified-guava-28.1-android (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.base.CharMatcher found in modules jetified-guava-28.1-android (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.base.CharMatcher$1 found in modules jetified-guava-28.1-android (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.base.CharMatcher$And found in modules jetified-guava-28.1-android (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.base.CharMatcher$BitSetMatcher found in modules jetified-guava-28.1-android (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.base.CharMatcher$FastMatcher found in modules jetified-guava-28.1-android (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.base.CharMatcher$NegatedFastMatcher found in modules jetified-guava-28.1-android (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.base.CharMatcher$Or found in modules jetified-guava-28.1-android (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.base.CharMatcher$RangesMatcher found in modules jetified-guava-28.1-android (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.base.Charsets found in modules jetified-guava-28.1-android (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.base.Converter found in modules jetified-guava-28.1-android (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.base.Converter$1 found in modules jetified-guava-28.1-android (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.base.Converter$1$1 found in modules jetified-guava-28.1-android (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.base.Converter$ConverterComposition found in modules jetified-guava-28.1-android (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.base.Converter$FunctionBasedConverter found in modules jetified-guava-28.1-android (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.base.Converter$IdentityConverter found in modules jetified-guava-28.1-android (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.base.Converter$ReverseConverter found in modules jetified-guava-28.1-android (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.base.Defaults found in modules jetified-guava-28.1-android (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.base.Enums found in modules jetified-guava-28.1-android (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.base.Enums$StringConverter found in modules jetified-guava-28.1-android (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.base.Equivalence found in modules jetified-guava-28.1-android (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.base.Equivalence$1 found in modules jetified-guava-28.1-android (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.base.Equivalence$Equals found in modules jetified-guava-28.1-android (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.base.Equivalence$EquivalentToPredicate found in modules jetified-guava-28.1-android (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.base.Equivalence$Identity found in modules jetified-guava-28.1-android (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.base.Equivalence$Wrapper found in modules jetified-guava-28.1-android (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.base.FinalizablePhantomReference found in modules jetified-guava-28.1-android (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.base.FinalizableReference found in modules jetified-guava-28.1-android (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.base.FinalizableReferenceQueue found in modules jetified-guava-28.1-android (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.base.FinalizableReferenceQueue$DecoupledLoader found in modules jetified-guava-28.1-android (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.base.FinalizableReferenceQueue$DirectLoader found in modules jetified-guava-28.1-android (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
Duplicate class com.google.common.base.FinalizableReferenceQueue$FinalizerLoader found in modules jetified-guava-28.1-android (com.google.guava:guava:28.1-android) and jetified-guava-jdk5-17.0 (com.google.guava:guava-jdk5:17.0)
.............................
Related
Android throws "duplicat class found" at me but I did not do anthing
What can I do with this error? Find nothing on the internet
Duplicate class kotlin.collections.jdk8.CollectionsJDK8Kt found in modules kotlin-stdlib-1.8.0 (org.jetbrains.kotlin:kotlin-stdlib:1.8.0) and kotlin-stdlib-jdk8-1.7.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.21)
Duplicate class kotlin.internal.jdk7.JDK7PlatformImplementations found in modules kotlin-stdlib-1.8.0 (org.jetbrains.kotlin:kotlin-stdlib:1.8.0) and kotlin-stdlib-jdk7-1.7.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.21)
Duplicate class kotlin.internal.jdk7.JDK7PlatformImplementations$ReflectSdkVersion found in modules kotlin-stdlib-1.8.0 (org.jetbrains.kotlin:kotlin-stdlib:1.8.0) and kotlin-stdlib-jdk7-1.7.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.21)
Duplicate class kotlin.internal.jdk8.JDK8PlatformImplementations found in modules kotlin-stdlib-1.8.0 (org.jetbrains.kotlin:kotlin-stdlib:1.8.0) and kotlin-stdlib-jdk8-1.7.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.21)
Duplicate class kotlin.internal.jdk8.JDK8PlatformImplementations$ReflectSdkVersion found in modules kotlin-stdlib-1.8.0 (org.jetbrains.kotlin:kotlin-stdlib:1.8.0) and kotlin-stdlib-jdk8-1.7.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.21)
Duplicate class kotlin.io.path.DirectoryEntriesReader found in modules kotlin-stdlib-1.8.0 (org.jetbrains.kotlin:kotlin-stdlib:1.8.0) and kotlin-stdlib-jdk7-1.7.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.21)
Duplicate class kotlin.io.path.ExperimentalPathApi found in modules kotlin-stdlib-1.8.0 (org.jetbrains.kotlin:kotlin-stdlib:1.8.0) and kotlin-stdlib-jdk7-1.7.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.21)
Duplicate class kotlin.io.path.FileVisitorBuilder found in modules kotlin-stdlib-1.8.0 (org.jetbrains.kotlin:kotlin-stdlib:1.8.0) and kotlin-stdlib-jdk7-1.7.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.21)
Duplicate class kotlin.io.path.FileVisitorBuilderImpl found in modules kotlin-stdlib-1.8.0 (org.jetbrains.kotlin:kotlin-stdlib:1.8.0) and kotlin-stdlib-jdk7-1.7.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.21)
Duplicate class kotlin.io.path.FileVisitorImpl found in modules kotlin-stdlib-1.8.0 (org.jetbrains.kotlin:kotlin-stdlib:1.8.0) and kotlin-stdlib-jdk7-1.7.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.21)
Duplicate class kotlin.io.path.LinkFollowing found in modules kotlin-stdlib-1.8.0 (org.jetbrains.kotlin:kotlin-stdlib:1.8.0) and kotlin-stdlib-jdk7-1.7.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.21)
Duplicate class kotlin.io.path.PathNode found in modules kotlin-stdlib-1.8.0 (org.jetbrains.kotlin:kotlin-stdlib:1.8.0) and kotlin-stdlib-jdk7-1.7.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.21)
Duplicate class kotlin.io.path.PathRelativizer found in modules kotlin-stdlib-1.8.0 (org.jetbrains.kotlin:kotlin-stdlib:1.8.0) and kotlin-stdlib-jdk7-1.7.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.21)
Duplicate class kotlin.io.path.PathTreeWalk found in modules kotlin-stdlib-1.8.0 (org.jetbrains.kotlin:kotlin-stdlib:1.8.0) and kotlin-stdlib-jdk7-1.7.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.21)
Duplicate class kotlin.io.path.PathTreeWalk$bfsIterator$1 found in modules kotlin-stdlib-1.8.0 (org.jetbrains.kotlin:kotlin-stdlib:1.8.0) and kotlin-stdlib-jdk7-1.7.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.21)
Duplicate class kotlin.io.path.PathTreeWalk$dfsIterator$1 found in modules kotlin-stdlib-1.8.0 (org.jetbrains.kotlin:kotlin-stdlib:1.8.0) and kotlin-stdlib-jdk7-1.7.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.21)
Duplicate class kotlin.io.path.PathTreeWalkKt found in modules kotlin-stdlib-1.8.0 (org.jetbrains.kotlin:kotlin-stdlib:1.8.0) and kotlin-stdlib-jdk7-1.7.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.21)
Duplicate class kotlin.io.path.PathWalkOption found in modules kotlin-stdlib-1.8.0 (org.jetbrains.kotlin:kotlin-stdlib:1.8.0) and kotlin-stdlib-jdk7-1.7.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.21)
Duplicate class kotlin.io.path.PathsKt found in modules kotlin-stdlib-1.8.0 (org.jetbrains.kotlin:kotlin-stdlib:1.8.0) and kotlin-stdlib-jdk7-1.7.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.21)
Duplicate class kotlin.io.path.PathsKt__PathReadWriteKt found in modules kotlin-stdlib-1.8.0 (org.jetbrains.kotlin:kotlin-stdlib:1.8.0) and kotlin-stdlib-jdk7-1.7.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.21)
Duplicate class kotlin.io.path.PathsKt__PathUtilsKt found in modules kotlin-stdlib-1.8.0 (org.jetbrains.kotlin:kotlin-stdlib:1.8.0) and kotlin-stdlib-jdk7-1.7.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.21)
Duplicate class kotlin.jdk7.AutoCloseableKt found in modules kotlin-stdlib-1.8.0 (org.jetbrains.kotlin:kotlin-stdlib:1.8.0) and kotlin-stdlib-jdk7-1.7.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.21)
Duplicate class kotlin.jvm.jdk8.JvmRepeatableKt found in modules kotlin-stdlib-1.8.0 (org.jetbrains.kotlin:kotlin-stdlib:1.8.0) and kotlin-stdlib-jdk8-1.7.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.21)
Duplicate class kotlin.jvm.optionals.OptionalsKt found in modules kotlin-stdlib-1.8.0 (org.jetbrains.kotlin:kotlin-stdlib:1.8.0) and kotlin-stdlib-jdk8-1.7.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.21)
Duplicate class kotlin.random.jdk8.PlatformThreadLocalRandom found in modules kotlin-stdlib-1.8.0 (org.jetbrains.kotlin:kotlin-stdlib:1.8.0) and kotlin-stdlib-jdk8-1.7.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.21)
Duplicate class kotlin.streams.jdk8.StreamsKt found in modules kotlin-stdlib-1.8.0 (org.jetbrains.kotlin:kotlin-stdlib:1.8.0) and kotlin-stdlib-jdk8-1.7.21 (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.21)
and so on ...
just add
implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.0"))
in dependencies
it solved my problem.
I'm no expert, but this same issue happened to me after changing my Kotlin version from 1.7.0 to 1.8.0. Check your app-level build.gradle file to make sure you're using your desired version (in your case, I believe it should be 1.8.0):
dependencies {
implementation 'androidx.core:core-ktx:1.8.0'
}
You must upgrade the Android Gradle Plugin to 1.8.0 on the top level build file.
plugins {
...
id 'org.jetbrains.kotlin.android' version '1.8.0' apply false
}
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('libs\deeparteffects-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)
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')
Context
Let's say I have the following module:
.
└── my_module
├── __init__.py
├── my_module_A.py (defines ClassA)
└── my_module_B.py (defines ClassB, which needs ClassA)
and the files are the following:
# __init__.py
from .my_module_A import ClassA
from .my_module_B import ClassB
# my_module_A.py
from my_module import ClassB
class ClassA:
def __init__(self, class_b: ClassB):
pass
# my_module_B.py
class ClassB:
def __init__(self):
pass
The important thing is that ClassB requires an instance of ClassA to be
instantiated.
Problem
Importing the module my_module raises an ImportError:
>>> # Working directory is the parent of my_module
>>> import my_module
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "foo/Module/my_module/__init__.py", line 3, in <module>
from .my_module_A import ClassA
File "foo/Module/my_module/my_module_A.py", line 3, in <module>
from my_module import ClassB
ImportError: cannot import name 'ClassB' from partially initialized module 'my_module' (most likely due to a circular import) (foo/Module/my_module/__init__.py)
The problem seems to be the following. When importing my_module, Python goes
through its __init__.py and starts by importing ClassA from my_module_A.
This file imports itself ClassB from my_module_B so this class is imported
for my_module as well. After my_module_A, Python tries to import ClassB
from my_module ; but it was already imported by my_module_A, so Python
raises ImportError.
Python suggests that the error may come from a circular import, but this is not
the case here. I really think that the problem is that the class ClassB is
imported twice: if I do not import my_module_B in __init__.py and use a
relative import for my_module_B in my_module_A, the import is successful
and there is no exception raised.
Finding a solution
A possible solution is to use only relative imports in python files in
my_module. The problem is that some submodules in my_module required
themselves a lot of classes from my_module (about 20 for some of them) and it
is ugly and inconvenient for maintainers having to know precise file names
where classes are defined. So my question is: how can I keep using from my_modyle import … imports in my_module submodules? Thanks a lot.
P.S. Some of you may suggest to rethink my module organization. I thought of
that but there is no canonical way to do it and this flat structure is truly
easier and clearer. So if possible I would like to avoid this.
Python version: 3.9.1
The source of the problem is ClassB hasn't yet been loaded into my_module (in __init__.py) when my_module_A is being imported (this is hinted by the "partially initialized" bit in the error message).
You'll need to manually order the imports in __init__.py so that dependencies come before the modules that use them:
# __init__.py
from .my_module_B import ClassB
from .my_module_A import ClassA # uses ClassB
A more robust solution is to skip __init__.py and import directly from my_module_B, but as you say, this gets unwieldy with lots of modules.
# my_module_A.py
# relative imports also work here
from my_module.my_module_B import ClassB
class ClassA:
def __init__(self, class_b: ClassB):
pass
Here is my build.gradle(Project:Android) file
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
And here's gradle.build(Module:app) file
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "28.0.3"
defaultConfig {
applicationId "com.ibdadatmallik.escape"
minSdkVersion 19
targetSdkVersion 26
ndk {
moduleName "player_shared"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.google.android.gms:play-services:+'
compile files('libs/dagger-1.2.2.jar')
compile files('libs/javax.inject-1.jar')
compile files('libs/nineoldandroids-2.4.0.jar')
compile files('libs/support-v4-19.0.1.jar')
}
Building the APK generates the following errors
Duplicate class android.support.v4.accessibilityservice.AccessibilityServiceInfoCompat found in modules classes.jar (com.android.support:support-compat:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.ActionBarDrawerToggle found in modules classes.jar (com.android.support:support-core-ui:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.ActionBarDrawerToggle$Delegate found in modules classes.jar (com.android.support:support-core-ui:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.ActionBarDrawerToggle$DelegateProvider found in modules classes.jar (com.android.support:support-core-ui:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.ActionBarDrawerToggle$SlideDrawable found in modules classes.jar (com.android.support:support-core-ui:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.ActivityCompat found in modules classes.jar (com.android.support:support-compat:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.ActivityOptionsCompat found in modules classes.jar (com.android.support:support-compat:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.BackStackRecord found in modules classes.jar (com.android.support:support-fragment:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.BackStackRecord$Op found in modules classes.jar (com.android.support:support-fragment:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.BackStackState found in modules classes.jar (com.android.support:support-fragment:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.BackStackState$1 found in modules classes.jar (com.android.support:support-fragment:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.DialogFragment found in modules classes.jar (com.android.support:support-fragment:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.Fragment found in modules classes.jar (com.android.support:support-fragment:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.Fragment$1 found in modules classes.jar (com.android.support:support-fragment:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.Fragment$InstantiationException found in modules classes.jar (com.android.support:support-fragment:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.Fragment$SavedState found in modules classes.jar (com.android.support:support-fragment:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.Fragment$SavedState$1 found in modules classes.jar (com.android.support:support-fragment:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.FragmentActivity found in modules classes.jar (com.android.support:support-fragment:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.FragmentActivity$1 found in modules classes.jar (com.android.support:support-fragment:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.FragmentActivity$NonConfigurationInstances found in modules classes.jar (com.android.support:support-fragment:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.FragmentContainer found in modules classes.jar (com.android.support:support-fragment:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.FragmentManager found in modules classes.jar (com.android.support:support-fragment:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.FragmentManager$BackStackEntry found in modules classes.jar (com.android.support:support-fragment:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.FragmentManager$OnBackStackChangedListener found in modules classes.jar (com.android.support:support-fragment:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.FragmentManagerImpl found in modules classes.jar (com.android.support:support-fragment:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.FragmentManagerImpl$1 found in modules classes.jar (com.android.support:support-fragment:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.FragmentManagerImpl$2 found in modules classes.jar (com.android.support:support-fragment:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.FragmentManagerImpl$3 found in modules classes.jar (com.android.support:support-fragment:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.FragmentManagerImpl$4 found in modules classes.jar (com.android.support:support-fragment:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.FragmentManagerState found in modules classes.jar (com.android.support:support-fragment:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.FragmentManagerState$1 found in modules classes.jar (com.android.support:support-fragment:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.FragmentPagerAdapter found in modules classes.jar (com.android.support:support-fragment:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.FragmentState found in modules classes.jar (com.android.support:support-fragment:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.FragmentState$1 found in modules classes.jar (com.android.support:support-fragment:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.FragmentStatePagerAdapter found in modules classes.jar (com.android.support:support-fragment:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.FragmentTabHost found in modules classes.jar (com.android.support:support-fragment:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.FragmentTabHost$DummyTabFactory found in modules classes.jar (com.android.support:support-fragment:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.FragmentTabHost$SavedState found in modules classes.jar (com.android.support:support-fragment:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.FragmentTabHost$SavedState$1 found in modules classes.jar (com.android.support:support-fragment:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.FragmentTabHost$TabInfo found in modules classes.jar (com.android.support:support-fragment:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.FragmentTransaction found in modules classes.jar (com.android.support:support-fragment:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.ListFragment found in modules classes.jar (com.android.support:support-fragment:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.ListFragment$1 found in modules classes.jar (com.android.support:support-fragment:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.ListFragment$2 found in modules classes.jar (com.android.support:support-fragment:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.LoaderManager found in modules classes.jar (com.android.support:support-fragment:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.LoaderManager$LoaderCallbacks found in modules classes.jar (com.android.support:support-fragment:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.LoaderManagerImpl found in modules classes.jar (com.android.support:support-fragment:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.LoaderManagerImpl$LoaderInfo found in modules classes.jar (com.android.support:support-fragment:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.NavUtils found in modules classes.jar (com.android.support:support-core-utils:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.NotificationCompat found in modules classes.jar (com.android.support:support-compat:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.NotificationCompat$Action found in modules classes.jar (com.android.support:support-compat:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.NotificationCompat$BigPictureStyle found in modules classes.jar (com.android.support:support-compat:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.NotificationCompat$BigTextStyle found in modules classes.jar (com.android.support:support-compat:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.NotificationCompat$Builder found in modules classes.jar (com.android.support:support-compat:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.NotificationCompat$InboxStyle found in modules classes.jar (com.android.support:support-compat:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.NotificationCompat$NotificationCompatImpl found in modules classes.jar (com.android.support:support-compat:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.NotificationCompat$Style found in modules classes.jar (com.android.support:support-compat:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.NotificationCompatJellybean found in modules classes.jar (com.android.support:support-compat:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.ServiceCompat found in modules classes.jar (com.android.support:support-compat:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.ShareCompat found in modules classes.jar (com.android.support:support-compat:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.ShareCompat$IntentBuilder found in modules classes.jar (com.android.support:support-compat:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.ShareCompat$IntentReader found in modules classes.jar (com.android.support:support-compat:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.SuperNotCalledException found in modules classes.jar (com.android.support:support-fragment:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.TaskStackBuilder found in modules classes.jar (com.android.support:support-core-utils:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.app.TaskStackBuilder$SupportParentable found in modules classes.jar (com.android.support:support-core-utils:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.content.AsyncTaskLoader found in modules classes.jar (com.android.support:support-core-utils:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.content.AsyncTaskLoader$LoadTask found in modules classes.jar (com.android.support:support-core-utils:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.content.ContextCompat found in modules classes.jar (com.android.support:support-compat:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.content.CursorLoader found in modules classes.jar (com.android.support:support-core-utils:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.content.FileProvider found in modules classes.jar (com.android.support:support-core-utils:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.content.FileProvider$PathStrategy found in modules classes.jar (com.android.support:support-core-utils:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.content.FileProvider$SimplePathStrategy found in modules classes.jar (com.android.support:support-core-utils:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.content.IntentCompat found in modules classes.jar (com.android.support:support-compat:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.content.Loader found in modules classes.jar (com.android.support:support-core-utils:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.content.Loader$ForceLoadContentObserver found in modules classes.jar (com.android.support:support-core-utils:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.content.Loader$OnLoadCompleteListener found in modules classes.jar (com.android.support:support-core-utils:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.content.LocalBroadcastManager found in modules classes.jar (com.android.support:support-core-utils:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.content.LocalBroadcastManager$1 found in modules classes.jar (com.android.support:support-core-utils:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.content.LocalBroadcastManager$BroadcastRecord found in modules classes.jar (com.android.support:support-core-utils:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.content.LocalBroadcastManager$ReceiverRecord found in modules classes.jar (com.android.support:support-core-utils:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.content.ModernAsyncTask found in modules classes.jar (com.android.support:support-compat:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.content.ModernAsyncTask$1 found in modules classes.jar (com.android.support:support-compat:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.content.ModernAsyncTask$2 found in modules classes.jar (com.android.support:support-compat:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.content.ModernAsyncTask$3 found in modules classes.jar (com.android.support:support-compat:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.content.ModernAsyncTask$4 found in modules classes.jar (com.android.support:support-compat:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.content.ModernAsyncTask$AsyncTaskResult found in modules classes.jar (com.android.support:support-compat:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.content.ModernAsyncTask$InternalHandler found in modules classes.jar (com.android.support:support-compat:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.content.ModernAsyncTask$Status found in modules classes.jar (com.android.support:support-compat:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.content.ModernAsyncTask$WorkerRunnable found in modules classes.jar (com.android.support:support-compat:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.content.WakefulBroadcastReceiver found in modules classes.jar (com.android.support:support-core-utils:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.content.pm.ActivityInfoCompat found in modules classes.jar (com.android.support:support-compat:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.database.DatabaseUtilsCompat found in modules classes.jar (com.android.support:support-compat:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.graphics.drawable.DrawableCompat found in modules classes.jar (com.android.support:support-compat:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.hardware.display.DisplayManagerCompat found in modules classes.jar (com.android.support:support-compat:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.internal.view.SupportMenu found in modules classes.jar (com.android.support:support-compat:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.internal.view.SupportMenuItem found in modules classes.jar (com.android.support:support-compat:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.internal.view.SupportSubMenu found in modules classes.jar (com.android.support:support-compat:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.net.ConnectivityManagerCompat found in modules classes.jar (com.android.support:support-compat:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
Duplicate class android.support.v4.net.ConnectivityManagerCompat$ConnectivityManagerCompatImpl found in modules classes.jar (com.android.support:support-compat:26.1.0) and support-v4-19.0.1.jar (support-v4-19.0.1.jar)
hello follow these steps and the error will be fixed.
1. click on Android SDK and select "SDK platforms" and install from Android 4.0 to android 9.+ check all
now at the same windows click SDK Tools and select these option:
2.1 android SDK Build-tools 29
2.2 android emulator
2.3 android SDK platform-tools
2.4 android SDK tools
2.5 support Repository
after installing these all download gradle (at this time of reply gradle version is 5.4.1) download it and extract it from zip folder.
no go to file settings it will open dialog-box from there select "Build, Execution, Deployment" in side that select "Gradle" and from
there select "Use local gradle distribution" and give path where you
extract your gradle version in (step 3) and click on.
click file and select "sync project with gralde files" wait until its download and sync
now build your project and you are done if you need more help you can ask :)
I just upgraded my project to the gradle 4.1 and now I am getting this error:
Supertypes of the following classes cannot be resolved. Please make
sure you have the required dependencies in the classpath: class com.google.android.gms.maps.model.LatLng, unresolved supertypes:
com.google.android.gms.common.internal.safeparcel.zza class com.google.android.gms.maps.model.PolylineOptions, unresolved supertypes:
com.google.android.gms.common.internal.safeparcel.zza class com.google.android.gms.maps.model.MarkerOptions, unresolved supertypes:
com.google.android.gms.common.internal.safeparcel.zza class com.google.android.gms.maps.model.CameraPosition, unresolved supertypes:
com.google.android.gms.common.internal.safeparcel.zza class com.google.android.gms.location.LocationRequest, unresolved supertypes:
com.google.android.gms.common.internal.safeparcel.zza class
com.google.android.gms.location.LocationSettingsRequest, unresolved
supertypes: com.google.android.gms.common.internal.safeparcel.zza class
com.google.android.gms.location.LocationSettingsResult, unresolved
supertypes: com.google.android.gms.common.internal.safeparcel.zza
I deleted my .gradle cache to see if that would resolve the error. No dice and I am not sure what's going on exactly. It was compiling before the upgrade without issue. Any ideas?
if you are using firebase and google play service with different version then you will face this problem.