stripe / stripe-react-native

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

Execution failed for task ':stripe_stripe-react-native:compileDebugKotlin'. #1560

Open nitinvarda opened 11 months ago

nitinvarda commented 11 months ago

Describe the bug Initialized react-native project, Installed @stripe/stripe-react-native and tried to run android, it throws an error

` FAILURE: Build failed with an exception.

Expected behavior The app builds successfully when using the library with fresh RN projects.

Screenshots N/A

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context

hayate commented 11 months ago

@nitinvarda had the same issue as you. Upgrading Kotlin version fixed the issue.

In the file android/build.gradle I had: kotlinVersion = "1.7.0" changing it to: kotlinVersion = "1.8.0" then ./gradlew clean and ./gradlew bundleRelease and the build succeeded.

nitinvarda commented 11 months ago

@hayate great you found a solution. Can you please tell me where to change the kotlin version, is it in build.gradle file or do I have to do that on Android studio?

nguyenhoanganhdev commented 11 months ago

@hayate In my file android/build.gradle kotlinVersion doesn't have specify version. What should I do

targetSdkVersion = Integer.parseInt(findProperty('android.targetSdkVersion') ?: '33') if (findProperty('android.kotlinVersion')) { kotlinVersion = findProperty('android.kotlinVersion') }

rakshitbharat commented 11 months ago

same error

rakshitbharat commented 11 months ago

551

this will help

AstrOOnauta commented 11 months ago

Into android/build.gradle, I just updated my kotlinVersion and kotlin_version from 1.6.21 to 1.8.0.

My project is RN Cli:

Aryan45231 commented 10 months ago

BUILD FAILED in 57s info Run CLI with --verbose flag for more details. facing same issue using reactnative : 0.73.0" @stripe/stripe-react-native v 0.35.0.

toscalivia83 commented 10 months ago

Having the same error

ketankapale8 commented 10 months ago

same!!! Error!!!

rishabraghav commented 9 months ago

@Aryan45231 I'm getting same issue as your's how did you solve it ?

nvdnvd00 commented 9 months ago

After upgrade to react-native 0.73.2 with kotlinVersion 1.8.0, I'm facing the same issue "@stripe/stripe-react-native": "^0.34.0"

ratneshkumarroot commented 9 months ago

Task :stripe_stripe-react-native:compileReleaseKotlin FAILED e: file:///Users/ratnesh/Documents/reactNative/beontime_client/beontime-client-reactnative/node_modules/@stripe/stripe-react-native/android/src/main/java/com/reactnativestripesdk/PaymentLauncherFragment.kt:170:63 Type mismatch: inferred type is <no name provided> but List was expected e: file:///Users/ratnesh/Documents/reactNative/beontime_client/beontime-client-reactnative/node_modules/@stripe/stripe-react-native/android/src/main/java/com/reactnativestripesdk/PaymentLauncherFragment.kt:207:6 No value passed for parameter 'callback' e: file:///Users/ratnesh/Documents/reactNative/beontime_client/beontime-client-reactnative/node_modules/@stripe/stripe-react-native/android/src/main/java/com/reactnativestripesdk/PaymentLauncherFragment.kt:211:65 Type mismatch: inferred type is <no name provided> but List was expected e: file:///Users/ratnesh/Documents/reactNative/beontime_client/beontime-client-reactnative/node_modules/@stripe/stripe-react-native/android/src/main/java/com/reactnativestripesdk/PaymentLauncherFragment.kt:248:6 No value passed for parameter 'callback' e: file:///Users/ratnesh/Documents/reactNative/beontime_client/beontime-client-reactnative/node_modules/@stripe/stripe-react-native/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt:612:24 Suspend function 'retrievePaymentIntent' should be called only from a coroutine or another suspend function e: file:///Users/ratnesh/Documents/reactNative/beontime_client/beontime-client-reactnative/node_modules/@stripe/stripe-react-native/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt:612:78 Type mismatch: inferred type is <no name provided> but List was expected e: file:///Users/ratnesh/Documents/reactNative/beontime_client/beontime-client-reactnative/node_modules/@stripe/stripe-react-native/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt:621:24 Suspend function 'retrieveSetupIntent' should be called only from a coroutine or another suspend function e: file:///Users/ratnesh/Documents/reactNative/beontime_client/beontime-client-reactnative/node_modules/@stripe/stripe-react-native/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt:621:76 Type mismatch: inferred type is <no name provided> but List was expected

daniloeder commented 2 months ago

I've solved this problem after removing this line from package.json dependencies: "expo-application": "~5.9.1".