stripe / stripe-react-native

React Native library for Stripe.
https://stripe.dev/stripe-react-native
MIT License
1.25k stars 258 forks source link

No variants found for 'stripe_stripe-react-native'. Check build files to ensure at least one variant exists. #432

Closed Zurdge closed 3 years ago

Zurdge commented 3 years ago

Describe the bug After running npm install @stripe/stripe-react-native I am unable to 'sync' my project in Android Studio. I get an error saying No variants found for 'stripe_stripe-react-native'. Check build files to ensure at least one variant exists.

To Reproduce Unfortunately, I cannot reproduce the issue myself. I created a new react-native project and Stripe worked perfectly which is a good thing. I'm hoping that someone knows/ is familiar with this error and knows how to solve it.

Expected behavior Ability to build app with Stripe implemented

Screenshots image

Desktop (please complete the following information):

Android Studio

build.gradle


// ....

dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    //noinspection GradleDynamicVersion
    implementation "com.facebook.react:react-native:+"  // From node_modules
    implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"

    compile project(':react-native-twilio-video-webrtc')

    // Required for OneSignal, even if you have added FCM.
    //compile 'com.google.android.gms:play-services-gcm:10.0.1'

    // Required for OneSignal & Stripe
    implementation 'com.google.android.gms:play-services-wallet:18.1.1'
    implementation 'androidx.appcompat:appcompat:1.2.0'

    implementation platform('com.google.firebase:firebase-bom:26.3.0')
    implementation 'com.google.firebase:firebase-messaging'

    debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
      exclude group:'com.facebook.fbjni'
    }

    implementation 'com.android.support:multidex:1.0.3'

    debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
        exclude group:'com.facebook.flipper'
        exclude group:'com.squareup.okhttp3', module:'okhttp'
    }
    debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
        exclude group:'com.facebook.flipper'
    }
    addUnimodulesDependencies()

    if (enableHermes) {
        def hermesPath = "../../node_modules/hermes-engine/android/";
        debugImplementation files(hermesPath + "hermes-debug.aar")
        releaseImplementation files(hermesPath + "hermes-release.aar")
    } else {
        implementation jscFlavor
    }
}

 //....
Zurdge commented 3 years ago

Closing, Ended up creating a new project and porting over everything to

"react": "17.0.1",
"react-native": "0.64.1",