Duplicate class com.google.firebase.iid.FirebaseInstanceIdReceiver found in modules jetified-firebase-iid-20.1.5-runtime (com.google.firebase:firebase-iid:20.1.5) and jetified-firebase-messaging-23.1.1-runtime (com.google.firebase:firebase-messaging:23.1.1)
I'm trying to integrate the Carrot Quest library and I'm facing a dependency conflict problem.
I tried to do exclude group, but without success
`
implementation ('io.carrotquest:android-sdk:1.0.60-commonRelease') {
exclude group: 'com.google.firebase'
}
`
Related
getting build error
I had also tried with adding
android.enableJetifier=true
but, still getting error
Run gradle dependencies
Find jetified-lifecycle-viewmodel-ktx-2.3.1-runtime is which libraries dependencies
Exclude it like:
.
implementation('...yourlibray...') {
exclude group: 'androidx.lifecycle', module: 'lifecycle-viewmodel'
}
In my Android app, I added a new dependency in the Gradle file. It turned out that this dependency is conflicting with one of the other dependencies in the project. When I'm trying to build the app I get the following error:
Duplicate class android.content.pm.IPackageStatsObserver found in modules jetified-androidcommon-debug-1.2.2-runtime (com.myapp.androidcommon:androidcommon-debug:1.2.2) and jetified-framework-1.12.0-runtime (com.dependency:framework:1.12.0)
Duplicate class android.content.pm.IPackageStatsObserver$Stub found in modules jetified-androidcommon-debug-1.2.2-runtime (com.myapp.androidcommon:androidcommon-debug:1.2.2) and jetified-framework-1.12.0-runtime (com.dependency:framework:1.12.0)
Duplicate class android.content.pm.IPackageStatsObserver$Stub$Proxy found in modules jetified-androidcommon-debug-1.2.2-runtime (com.myapp.androidcommon:androidcommon-debug:1.2.2) and jetified-framework-1.12.0-runtime (com.dependency:framework:1.12.0)
As the log shows the problem is 3 duplicated classes that are present in both dependencies. To solve this I tried to exclude the android.content.pm package from one or the other dependency like that:
implementation ('com.dependency:framework:1.12.0') {
exclude group: 'android.content.pm'
}
or like that:
implementation('com.myapp.androidcommon:androidcommon-debug:1.2.2') {
exclude group: 'android.content.pm'
}
but I keep getting the same error. Any idea how to solve this issue?
I am using admob and facebook for ads in my app and its done but I want to check it so i have added Mediation Test Suite depnedancy
implementation 'com.google.android.ads:mediation-test-suite:2.0.0'
And the app could not build it shows
Duplicate class com.google.android.flexbox.AlignContent found in modules jetified-flexbox-1.1.1-runtime (com.google.android:flexbox:1.1.1) and jetified-flexbox-3.0.0-runtime (com.google.android.flexbox:flexbox:3.0.0)
Duplicate class com.google.android.flexbox.AlignItems found in modules jetified-flexbox-1.1.1-runtime (com.google.android:flexbox:1.1.1) and jetified-flexbox-3.0.0-runtime (com.google.android.flexbox:flexbox:3.0.0)
And many more Duplicate Class of Flexbox
my admob version
implementation 'com.google.android.gms:play-services-ads:20.4.0'
The package name is wrong.
com.google.android:flexbox:1.1.1
Here is the correct one. ↓
implementation ('com.google.android.ads:mediation-test-suite:2.0.0') {
exclude group: "com.google.android", module: "flexbox"
}
It worked for me.
Exclude the flexbox module which is causing the conflict like this...
implementation ('com.google.android.ads:mediation-test-suite:2.0.0') {
exclude group: "com.google.android.flexbox", module: "flexbox"
}
I'm using Coroutine and Paging 3 Libary on my project on changing new Version of libary most of the time i will get this Duplicate Class Error , So what is the proper way to get rid of such problems with changing library version...
Duplicate class kotlinx.coroutines.AbstractCoroutine found in modules jetified-kotlinx-
coroutines-core-jvm-1.4.1.jar (org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.4.1) and
jetified-kotlinx-coroutines-core-jvm-1.4.1.jar (org.jetbrains.kotlinx:kotlinx-coroutines-
core:1.4.1)
Duplicate class kotlinx.coroutines.Active found in modules jetified-kotlinx-coroutines-core-
jvm-1.4.1.jar (org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.4.1) and jetified-kotlinx-
coroutines-core-jvm-1.4.1.jar (org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.1)
Duplicate class kotlinx.coroutines.AwaitAll found in modules jetified-kotlinx-coroutines-core-
jvm-1.4.1.jar (org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.4.1) and jetified-kotlinx-
coroutines-core-jvm-1.4.1.jar (org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.1)
Duplicate class kotlinx.coroutines.AwaitAll$AwaitAllNode found in modules jetified-kotlinx-
coroutines-core-jvm-1.4.1.jar (org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.4.1) and
jetified-kotlinx-coroutines-core-jvm-1.4.1.jar (org.jetbrains.kotlinx:kotlinx-coroutines-
core:1.4.1)
I resolved it.
def paging_version_3 = "3.0.0-alpha12"
implementation ("androidx.paging:paging-runtime-ktx:$paging_version_3")
{
exclude group: 'org.jetbrains.kotlinx', module: 'kotlinx-coroutines-core-jvm'
}
// optional - RxJava3 support
implementation ("androidx.paging:paging-rxjava3:$paging_version_3")
{
exclude group: 'org.jetbrains.kotlinx', module: 'kotlinx-coroutines-core-jvm'
}
// leanback paging library
implementation ("androidx.leanback:leanback-paging:1.1.0-alpha07")
{
exclude group: 'org.jetbrains.kotlinx', module: 'kotlinx-coroutines-core-jvm'
}
exclude group: 'org.jetbrains.kotlinx', module: 'kotlinx-coroutines-core-jvm'
You can remove and clear the cache and recompile it , under the Gradle Plugin module,find the Dependencies under Help
I am trying to migrate to drive v3 api for my android app and I have followed instructions provided inhttps://github.com/gsuitedevs/android-samples/tree/master/drive/deprecation to migrate. I am getting dependency resolution errors.
I have used duplicate classes shown in log in exclude option but it haven't worked
list of my drive api dependencies
implementation 'com.google.android.gms:play-services-ads:17.2.0'
implementation 'com.google.android.gms:play-services-auth:16.0.1'
implementation 'com.google.http-client:google-http-client-gson:1.29.1'
implementation('com.google.api-client:google-api-client-android:1.28.0') {
exclude group: 'org.apache.httpcomponents'
}
implementation('com.google.apis:google-api-services-drive:v3-rev99-1.23.0') {
exclude group: 'org.apache.httpcomponents'
}
Below are the error lines shown
Duplicate class com.google.api.client.http.apache.ApacheHttpRequest found in modules google-http-client-1.29.1.jar (com.google.http-client:google-http-client:1.29.1) and google-http-client-apache-2.0.0.jar (com.google.http-client:google-http-client-apache:2.0.0)
Duplicate class com.google.api.client.http.apache.ApacheHttpResponse found in modules google-http-client-1.29.1.jar (com.google.http-client:google-http-client:1.29.1) and google-http-client-apache-2.0.0.jar (com.google.http-client:google-http-client-apache:2.0.0)
Duplicate class com.google.api.client.http.apache.ApacheHttpTransport found in modules google-http-client-1.29.1.jar (com.google.http-client:google-http-client:1.29.1) and google-http-client-apache-2.0.0.jar (com.google.http-client:google-http-client-apache:2.0.0)
Duplicate class com.google.api.client.http.apache.ContentEntity found in modules google-http-client-1.29.1.jar (com.google.http-client:google-http-client:1.29.1) and google-http-client-apache-2.0.0.jar (com.google.http-client:google-http-client-apache:2.0.0)
Duplicate class com.google.api.client.http.apache.HttpExtensionMethod found in modules google-http-client-1.29.1.jar (com.google.http-client:google-http-client:1.29.1) and google-http-client-apache-2.0.0.jar (com.google.http-client:google-http-client-apache:2.0.0)
Looking at the error message:
found in modules google-http-client-1.29.1.jar
it seems to reference:
implementation 'com.google.http-client:google-http-client-gson:1.29.1'
Based upon the version number. Have you tried to exclude the library from that artefact too?