I am trying to implement flutter plugin in_app_review in one of my flutter project but i am getting duplicate dependency error. I think some of the plugin from my project is somewhere adding play core dependency which is causing this issue. Please help me figure out the solution.
I am getting this error log.
Execution failed for task ':app:checkUatDebugDuplicateClasses'.
A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable Duplicate class com.google.android.play.core.common.IntentSenderForResultStarter found in modules jetified-core-1.8.0-runtime (com.google.android.play:core:1.8.0) and jetified-core-common-2.0.2-runtime (com.google.android.play:core-common:2.0.2) Duplicate class com.google.android.play.core.common.LocalTestingException found in modules jetified-core-1.8.0-runtime (com.google.android.play:core:1.8.0) and jetified-core-common-2.0.2-runtime (com.google.android.play:core-common:2.0.2) Duplicate class com.google.android.play.core.common.PlayCoreDialogWrapperActivity found in modules jetified-core-1.8.0-runtime (com.google.android.play:core:1.8.0) and jetified-core-common-2.0.2-runtime (com.google.android.play:core-common:2.0.2) Duplicate class com.google.android.play.core.listener.StateUpdatedListener found in modules jetified-core-1.8.0-runtime (com.google.android.play:core:1.8.0) and jetified-core-common-2.0.2-runtime (com.google.android.play:core-common:2.0.2) Duplicate class com.google.android.play.core.review.ReviewInfo found in modules jetified-core-1.8.0-runtime (com.google.android.play:core:1.8.0) and jetified-review-2.0.1-runtime (com.google.android.play:review:2.0.1) Duplicate class com.google.android.play.core.review.ReviewManager found in modules jetified-core-1.8.0-runtime (com.google.android.play:core:1.8.0) and jetified-review-2.0.1-runtime (com.google.android.play:review:2.0.1) Duplicate class com.google.android.play.core.review.ReviewManagerFactory found in modules jetified-core-1.8.0-runtime (com.google.android.play:core:1.8.0) and jetified-review-2.0.1-runtime (com.google.android.play:review:2.0.1) Duplicate class com.google.android.play.core.review.testing.FakeReviewManager found in modules jetified-core-1.8.0-runtime (com.google.android.play:core:1.8.0) and jetified-review-2.0.1-runtime (com.google.android.play:review:2.0.1)
I found the solution to the problem. It was happening because I was using;
implementation 'com.google.android.play:core:1.10.3'implementation'com.google.android.play:core-ktx:1.8.1'These two dependencies are in my android folder for in-app update and I thought
com.google.android.play:core:1.10.3is responsible for the duplicate dependency issue so when I commented that out it was still giving duplicate dependency issue ascom.google.android.play:core-ktx:1.8.1is also the same so I check on developer guide page where this dependency is now separated according to feature from core dependency then I removed this two dependencies and added implementation'com.google.android.play:app-update-ktx:2.0.1'this one as I was doing the in-app update as well. which helped me fix my problem.