MinaSamir11 / react-native-in-app-review

The Google Play In-App Review API, App store rating API lets you prompt users to submit Play Store or App store ratings and reviews without the inconvenience of leaving your app or game.
MIT License
646 stars 56 forks source link

fail to build android app:checkDebugDuplicateClasses #153

Closed w3company-leo closed 10 months ago

w3company-leo commented 11 months ago

-----------
* What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> 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.10.3-runtime (com.google.android.play:core:1.10.3) 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.10.3-runtime (com.google.android.play:core:1.10.3) 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.10.3-runtime (com.google.android.play:core:1.10.3) 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.10.3-runtime (com.google.android.play:core:1.10.3) 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.ReviewException found in modules jetified-core-1.10.3-runtime (com.google.android.play:core:1.10.3) and jetified-review-2.0.1-runtime (com.google.android.play:review:2.0.1)
     Duplicate class com.google.android.play.core.review.ReviewInfo found in modules jetified-core-1.10.3-runtime (com.google.android.play:core:1.10.3) 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.10.3-runtime (com.google.android.play:core:1.10.3) 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.10.3-runtime (com.google.android.play:core:1.10.3) and jetified-review-2.0.1-runtime (com.google.android.play:review:2.0.1)
     Duplicate class com.google.android.play.core.review.model.ReviewErrorCode found in modules jetified-core-1.10.3-runtime (com.google.android.play:core:1.10.3) and jetified-review-2.0.1-runtime (com.google.android.play:review:2.0.1)
     Duplicate class com.google.android.play.core.review.model.zza found in modules jetified-core-1.10.3-runtime (com.google.android.play:core:1.10.3) 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.10.3-runtime (com.google.android.play:core:1.10.3) and jetified-review-2.0.1-runtime (com.google.android.play:review:2.0.1)
     Duplicate class com.google.android.play.core.review.zza found in modules jetified-core-1.10.3-runtime (com.google.android.play:core:1.10.3) and jetified-review-2.0.1-runtime (com.google.android.play:review:2.0.1)
     Duplicate class com.google.android.play.core.review.zzb found in modules jetified-core-1.10.3-runtime (com.google.android.play:core:1.10.3) and jetified-review-2.0.1-runtime (com.google.android.play:review:2.0.1)
     Duplicate class com.google.android.play.core.review.zzc found in modules jetified-core-1.10.3-runtime (com.google.android.play:core:1.10.3) and jetified-review-2.0.1-runtime (com.google.android.play:review:2.0.1)
     Duplicate class com.google.android.play.core.review.zzd found in modules jetified-core-1.10.3-runtime (com.google.android.play:core:1.10.3) and jetified-review-2.0.1-runtime (com.google.android.play:review:2.0.1)
     Duplicate class com.google.android.play.core.review.zze found in modules jetified-core-1.10.3-runtime (com.google.android.play:core:1.10.3) and jetified-review-2.0.1-runtime (com.google.android.play:review:2.0.1)
     Duplicate class com.google.android.play.core.review.zzf found in modules jetified-core-1.10.3-runtime (com.google.android.play:core:1.10.3) and jetified-review-2.0.1-runtime (com.google.android.play:review:2.0.1)
     Duplicate class com.google.android.play.core.review.zzg found in modules jetified-core-1.10.3-runtime (com.google.android.play:core:1.10.3) and jetified-review-2.0.1-runtime (com.google.android.play:review:2.0.1)
     Duplicate class com.google.android.play.core.review.zzh found in modules jetified-core-1.10.3-runtime (com.google.android.play:core:1.10.3) and jetified-review-2.0.1-runtime (com.google.android.play:review:2.0.1)
     Duplicate class com.google.android.play.core.review.zzi found in modules jetified-core-1.10.3-runtime (com.google.android.play:core:1.10.3) and jetified-review-2.0.1-runtime (com.google.android.play:review:2.0.1)

     Go to the documentation to learn how to <a href="d.android.com/r/tools/classpath-sync-errors">Fix dependency resolution errors</a>.

react-native : 0.70.8

dsipahioglu commented 10 months ago

Having the same issue in RN 0.72.3 with "react-native-in-app-review": "^4.3.3".

Tried listing dependencies with "./gradlew app:dependencies" and searched for "play:core" within the results find the clashing dependencies but I don't know what I should do next.

olcaneristi commented 10 months ago

any updates??

i'm having the same issue in RN 0.72.3 with 4.3.3.

dsipahioglu commented 10 months ago

@w3company-leo

I think I found a workaround. In node_modules > react-native-in-app-review > android > build.gradle

I changed the dependencies to:

dependencies {
    implementation "com.facebook.react:react-native:+"  // From node_modules
    // implementation "com.google.android.play:review:${safeExtGet('playReviewVersion')}" REMOVED THIS
    implementation "com.google.android.play:core:1.8.0" // ADDED THIS
    implementation "com.google.android.gms:play-services-base:${safeExtGet('playServicesVersion')}"
}

In android > src > main > java > com > ..... > AppReviewModule.java I changed the gms Tasks import to this one:

import com.google.android.play.core.tasks.Task;

image

It builds, but not sure if it works in production mode.

w3company-leo commented 10 months ago

@dsipahioglu

Oh! It works in production mode!! Thank you for sharing the solution!!

kolindalanaresh commented 9 months ago

@dsipahioglu, @w3company-leo still i am facing the same issue with react native version 0.64.2 and react-native-in-app-review 4.3.1 version. Can you please suggest on this

dsipahioglu commented 8 months ago

@dsipahioglu, @w3company-leo still i am facing the same issue with react native version 0.64.2 and react-native-in-app-review 4.3.1 version. Can you please suggest on this

Is your error exactly the same or something different? You might have different packages that have clashing dependencies. Can you provide the error log?

askmakdag commented 5 months ago

I was facing the same issue in RN 0.72.6 with 4.3.3.

Making sure the JDK is set to Azul zulu version 11.0.19 solved my problem.

![Uploading Screenshot 2024-01-15 at 16.49.02.png…]()