skip to Main Content

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.

enter image description here

enter image description here

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


  1. The error message says that there are duplicate bouncycastle modules in your Android project, and you should exclude one of them.

    1. Go to /android folder and run ./gradlew app:dependencies to view the gradle dependency tree. Search org.bouncycastle and you should find two matches (e.g., one under com.stripe:stripe-3ds2-android and the other one under your other dependency)
    2. Open the build.gradle file in /android/app folder and add the gradle configuration if you wish you exclude the bouncycastle required by Stripe.
    implementation ('com.stripe:stripe-android:20.14.0') {
        exclude group: "org.bouncycastle", module: "bcprov-jdk15to18"
    }
    
    Login or Signup to reply.
  2. I have fixed the issue by adding the following lines in app/build.gradle dependencies:

    implementation (project(':stripe_stripe-react-native')) {
          exclude group: "org.bouncycastle", module: "bcprov-jdk15to18"
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search