0

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)

abhishek singh
  • 103
  • 1
  • 1
  • 6
  • https://stackoverflow.com/questions/56716047/execution-failed-for-task-appcheckdebugduplicateclasses-ionic4-android – MANISH DAYMA Feb 20 '23 at 05:37

3 Answers3

2

my app has both in_app_review and rate_my_app and i have the same issue. i solved it by locking in_app_review to 2.0.4: 2.0.4 not ^2.0.4.

looks like 2.0.5 introduced this bug.

  • For now I also had to set `rate_my_app: "1.1.3"` rather than ^1.1.3 - at least until I have time to investigate further as the latest `1.1.4` also seems to introduce the issue. – Calholl Apr 02 '23 at 05:01
0

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.3 is responsible for the duplicate dependency issue so when I commented that out it was still giving duplicate dependency issue as com.google.android.play:core-ktx:1.8.1 is 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.

Andrej
  • 2,743
  • 2
  • 11
  • 28
abhishek singh
  • 103
  • 1
  • 1
  • 6
0

For me it removing the rate_my_app package fixed it