hi , Im getting this error , can anyone help
# community-support
k
hi , Im getting this error , can anyone help
d
I don't have experience with Android/Gradle together, but the way that error reads, you have two dependencies that are providing the same class. I don't know what the preference should be, but in Java you typically want to avoid duplicating classes, as you may have variable results at runtime.
The conflict, however, appears to be happening because you depend on both
com.google.android.play:core
and
com.google.android.play:core-common
k
Im not using com.google.android.play:core anywhere in gradle
d
You might not be, but a different dependency might be transitively providing it. You can run
./gradlew :app:dependencies --configuration compileClasspath | less
to view your compile classpath and search for any reference of
com.google.android.play:core
in the tree.
k
okay . Ill try thank you
could not able to debug 😅
d
Try sharing the output of the above without the
| less
k
d
Ah, yeah I'd say I'm unsure here since that classpath is what I typically refer to in pure Java. Does the output of the error you started the thread with mention any configuration or classpath? I'm unfamiliar what configurations exist for Android.
You might be able to do it without
--configuration compileClasspath
but that output might take more time to decipher.
k
I have run this command without configuration compileClasspath
d
What configurations do you see?
k
Untitled
d
The top of your output is clipped out and missing some information
However I think I can see some context, assuming this is the correct configuration.
k
so , is there any solution Im stuck with this for 2 days
d
You have a direct dependency on
instabug
, which transitively provides
core-common
(see the bottom of the output):
Copy code
+--- project :instabug_flutter
|    +--- com.instabug.library:instabug:12.7.1
|    |    +--- com.instabug.library:instabug-core:12.7.1
|    |    |    +--- androidx.legacy:legacy-support-v4:1.0.0 (*)
|    |    |    +--- com.google.android.material:material:1.0.0
|    |    |    |    +--- androidx.annotation:annotation:1.0.0 -> 1.7.0 (*)
|    |    |    |    +--- androidx.core:core:1.0.0 -> 1.10.1 (*)
|    |    |    |    +--- androidx.legacy:legacy-support-core-ui:1.0.0 (*)
|    |    |    |    +--- androidx.legacy:legacy-support-core-utils:1.0.0 (*)
|    |    |    |    +--- androidx.fragment:fragment:1.0.0 -> 1.3.6 (*)
|    |    |    |    +--- androidx.transition:transition:1.0.0
|    |    |    |    |    +--- androidx.annotation:annotation:1.0.0 -> 1.7.0 (*)
|    |    |    |    |    \--- androidx.core:core:1.0.0 -> 1.10.1 (*)
|    |    |    |    +--- androidx.appcompat:appcompat:1.0.0 -> 1.5.1 (*)
|    |    |    |    +--- androidx.cardview:cardview:1.0.0 (*)
|    |    |    |    \--- androidx.recyclerview:recyclerview:1.0.0
|    |    |    |         +--- androidx.annotation:annotation:1.0.0 -> 1.7.0 (*)
|    |    |    |         +--- androidx.core:core:1.0.0 -> 1.10.1 (*)
|    |    |    |         \--- androidx.legacy:legacy-support-core-ui:1.0.0 (*)
|    |    |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.7.0 -> 1.8.22 (*)
|    |    |    \--- androidx.multidex:multidex:2.0.0
|    |    +--- com.instabug.library:instabug-survey:12.7.1
|    |    |    +--- com.instabug.library:instabug-core:12.7.1 (*)
|    |    |    +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.0 -> 1.8.22 (*)
|    |    |    \--- com.google.android.play:review:2.0.1
|    |    |         +--- com.google.android.gms:play-services-basement:18.1.0 -> 18.2.0 (*)
|    |    |         +--- com.google.android.gms:play-services-tasks:18.0.2 (*)
|    |    |         \--- com.google.android.play:core-common:2.0.2
Some of your other projects you depend on in this project appear to have direct dependencies on `core`:
Copy code
+--- project :in_app_update
|    +--- org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.31 -> 1.8.22 (*)
|    +--- com.google.android.play:core:1.10.3
+--- project :app_review
|    +--- androidx.legacy:legacy-support-v4:1.0.0 (*)
|    +--- com.google.android.play:core:1.8.2 -> 1.10.3
|    +--- project :package_info (*)
|    \--- io.flutter:flutter_embedding_release:1.0.0-0545f8705df301877d787107bac1a6e9fc9ee1ad (*)
k
Yah I have integrated insta bug in my flutter application , only after that Im getting this issue
for Ios its fine but for android throwing error
So what can I do to reslove this ?
d
I think you'll need to either exclude
core-common
as a dependency (probably riskier) or change your project implementations to depend on
core-common
instead.
I don't know what the difference in the two libraries entail, this is just speaking from the conflict happening and picking the route I think would be easier to solve (changing your implementation around rather than being hopeful that excluding
core-common
wouldn't cause problems)
k
how can i Exclude it
d
Inside your buildscript, you can completely exclude
core-common
using the following
Copy code
configurations.configureEach {
    exclude group: 'com.google.android.play', module: 'core-common'
}
However you should be careful, and determine the actual configuration. I can't tell what it is by the output you provided. The example I provided excludes it from all configurations.
k
hmmm okay thanks bro
you can view full snippet by clicking here . I tried to exclude but that didnt work
d
I did, the top is still missing some output. Your terminal might not be retaining the lines because the output is too long.
Gradle typically tells you the configuration before showing you the tree.
k
hmm but it didnt I think
d
Right, your tree should start with a direct dependency, and the top most line in your output is showing a transitive level dependency (at least judging by the indentation)