react-native-in-app-review: Android Error Duplicate class com.google.android.play.core.common

Duplicate class com.google.android.play.core.common.IntentSenderForResultStarter found in modules jetified-core-1.9.0-runtime (com.google.android.play:core:1.9.0) and jetified-core-common-2.0.0-runtime (com.google.android.play:core-common:2.0.0)
    Duplicate class com.google.android.play.core.common.LocalTestingException found in modules jetified-core-1.9.0-runtime (com.google.android.play:core:1.9.0) and jetified-core-common-2.0.0-runtime (com.google.android.play:core-common:2.0.0)
    Duplicate class com.google.android.play.core.common.PlayCoreDialogWrapperActivity found in modules jetified-core-1.9.0-runtime (com.google.android.play:core:1.9.0) and jetified-core-common-2.0.0-runtime (com.google.android.play:core-common:2.0.0)
    Duplicate class com.google.android.play.core.listener.StateUpdatedListener found in modules jetified-core-1.9.0-runtime (com.google.android.play:core:1.9.0) and jetified-core-common-2.0.0-runtime (com.google.android.play:core-common:2.0.0)
    Duplicate class com.google.android.play.core.review.ReviewInfo found in modules jetified-core-1.9.0-runtime (com.google.android.play:core:1.9.0) and jetified-review-2.0.0-runtime (com.google.android.play:review:2.0.0)
    Duplicate class com.google.android.play.core.review.ReviewManager found in modules jetified-core-1.9.0-runtime (com.google.android.play:core:1.9.0) and jetified-review-2.0.0-runtime (com.google.android.play:review:2.0.0)
    Duplicate class com.google.android.play.core.review.ReviewManagerFactory found in modules jetified-core-1.9.0-runtime (com.google.android.play:core:1.9.0) and jetified-review-2.0.0-runtime (com.google.android.play:review:2.0.0)
    Duplicate class com.google.android.play.core.review.testing.FakeReviewManager found in modules jetified-core-1.9.0-runtime (com.google.android.play:core:1.9.0) and jetified-review-2.0.0-runtime (com.google.android.play:review:2.0.0)
"react-native-in-app-review": "4.1.1",
 "react-native-webview": "^11.25.0",
 "react-native-wonderpush": "^2.2.4",
    OS: macOS 13.0.1
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 31.38 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.10.0 - ~/.nvm/versions/node/v16.10.0/bin/node
    Yarn: 1.22.18 - /usr/local/bin/yarn
    npm: 7.24.0 - ~/.nvm/versions/node/v16.10.0/bin/npm
    Watchman: 2022.03.21.00 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.11.3 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 22.1, iOS 16.1, macOS 13.0, tvOS 16.1, watchOS 9.1
    Android SDK:
      API Levels: 26, 27, 28, 29, 30, 31, 32, 33
      Build Tools: 27.0.3, 28.0.3, 29.0.0, 29.0.2, 29.0.3, 30.0.0, 30.0.2, 30.0.3, 31.0.0, 31.0.0, 32.0.0, 32.1.0, 33.0.0, 33.0.0, 33.0.0, 33.0.0, 33.0.1
      System Images: android-26 | Intel x86 Atom_64, android-26 | Google Play Intel x86 Atom, android-27 | Intel x86 Atom_64, android-27 | Google Play Intel x86 Atom, android-28 | Intel x86 Atom, android-28 | Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom_64, android-28 | Google Play Intel x86 Atom, android-28 | Google X86_ARM Intel x86 Atom, android-29 | Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom, android-29 | Google APIs Intel x86 Atom_64, android-29 | Google Play Intel x86 Atom, android-29 | Google Play Intel x86 Atom_64, android-30 | Google APIs Intel x86 Atom, android-30 | Google APIs Intel x86 Atom_64, android-30 | Google Play Intel x86 Atom, android-30 | Google Play Intel x86 Atom_64, android-31 | Intel x86 Atom_64, android-31 | Google APIs ARM 64 v8a, android-31 | Google APIs Intel x86 Atom_64, android-31 | Google Play ARM 64 v8a, android-31 | Google Play Intel x86 Atom_64, android-32 | Google APIs Intel x86 Atom_64, android-32 | Google Play Intel x86 Atom_64, android-33 | Google APIs Intel x86 Atom_64, android-33 | Google Play Intel x86 Atom_64
      Android NDK: Not Found
  IDEs:
    Android Studio: 2021.3 AI-213.7172.25.2113.9014738
    Xcode: 14.1/14B47b - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.11 - /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: ^18.0.0 => 18.2.0 
    react-native: 0.69.6 => 0.69.6 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

```   minSdkVersion = 26
        compileSdkVersion = 33
        targetSdkVersion = 33
        buildToolsVersion = "33.0.1"
        androidXCore = "1.0.2"
        androidXAnnotation = "1.2.0"
        androidXBrowser = "1.3.0"

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 4
  • Comments: 26 (7 by maintainers)

Commits related to this issue

Most upvoted comments

getting these error on version v4.3.3

> 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)

Hello @MinaSamir11 !

Any update on the public registry release ? Thanks a lot! 💪

Sorry for the late response.

The new release is now available, follow the new readme.md installation steps. https://github.com/MinaSamir11/react-native-in-app-review/releases/tag/v4.3.1

For the public registry, the new release will be available in 10 days.

@MinaSamir11 done 😃

You can modify the build gradle file in the android project. Replace line 56 with implementation ‘com.google.android.play:review:2.0.0’

Then inside the AppReviewModule.java replace line 18 with import com.google.android.gms.tasks.Task;

This will work with the wonderpush library as it is no longer making use of the play core library but instead using the review library only.

I have forked it here: https://github.com/Solly74/react-native-in-app-review

Thanks @Solly74 , It’s work for me.

@Solly74
Doing Great, Can you please make a pull request of your changes to merge it and please update this -> implementation ‘com.google.android.play:review:2.0.1’

@MinaSamir11 please let us know if the code from the above fork looks OK from your perspective or if there is anything to be improved. If you think it’s OK we could create a pull request. I have tested the fork and it appears to work OK. CC: @Etaliya @Solly74

You can modify the build gradle file in the android project. Replace line 56 with implementation ‘com.google.android.play:review:2.0.0’

Then inside the AppReviewModule.java replace line 18 with import com.google.android.gms.tasks.Task;

This will work with the wonderpush library as it is no longer making use of the play core library but instead using the review library only.

I have forked it here: https://github.com/Solly74/react-native-in-app-review

nothing work

any solution???

I would check against any possible libraries that are using similar classes. I ran into this issue as well, but was ameliorated when I removed react-native-rate. You should run ./gradlew app:dependencies >> deps.txt and check the dependency tree for any conflicting versions/duplicate classes.

Hello @MinaSamir11 !

Any update on the public registry release ? Thanks a lot! 💪

the new public version is available now V4.3.1

@MinaSamir11 please let us know if the code from the above fork looks OK from your perspective or if there is anything to be improved. If you think it’s OK we could create a pull request.

Great Sol.