i was getting this error during build time of android after two weeks of install stripe sdk, it was running perfectly before. it also running and building perfectly in IOS devices.
To Reproduce
Install using this code
Run ```yarn android
Terminal get error at 76% , appear this error : Unchecked cast : >Task: app:checkDebugDuplicateClasses Failed ( picture below)
Versions::
React versio": "17.0.2",
React native version: "0.68.2",
Stripe version: 0.19.0
buildToolsVersion = "31.0.0"
minSdkVersion = 21
compileSdkVersion = 33
targetSdkVersion = 31
2
Answers
The error message says that there are duplicate
bouncycastle
modules in your Android project, and you should exclude one of them./android
folder and run./gradlew app:dependencies
to view the gradle dependency tree. Searchorg.bouncycastle
and you should find two matches (e.g., one undercom.stripe:stripe-3ds2-android
and the other one under your other dependency)build.gradle
file in/android/app
folder and add the gradle configuration if you wish you exclude the bouncycastle required by Stripe.I have fixed the issue by adding the following lines in
app/build.gradle
dependencies: