[英]Problem installing react-native stripe sdk
I installed react-native stripe sdk with the following command:我使用以下命令安装了 react-native 条纹 sdk:
npm install @stripe/stripe-react-native
After I try to build the app I get the following two errors:在我尝试构建应用程序后,我收到以下两个错误:
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* Where:
Build file 'C:\xampp\htdocs\SoFood\node_modules\@stripe\stripe-react-native\android\build.gradle' line: 18
* What went wrong:
A problem occurred evaluating project ':stripe_stripe-react-native'.
> Failed to apply plugin [id 'kotlin-android']
> The current Gradle version 5.4.1 is not compatible with the Kotlin Gradle plugin. Please use Gradle 6.1 or newer, or the previous version of the Kotlin plugin.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
A problem occurred configuring project ':stripe_stripe-react-native'.
> compileSdkVersion is not specified.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================
* Get more help at https://help.gradle.org
BUILD FAILED in 1m 40s
Any idea what could it be?知道会是什么吗?
It's saying that your current version of Gradle is not compatible with the package requirements.是说您当前版本的 Gradle 与 package 要求不兼容。 Try to upgrade the version of your Gradle.
尝试升级您的 Gradle 的版本。
How to do that: In android/build.gradle you have to edit this line如何做到这一点:在 android/build.gradle 你必须编辑这一行
classpath 'com.android.tools.build:gradle:x.y.z'
Modify the x and y and z with the version they suggested.使用他们建议的版本修改 x 和 y 和 z。 for example:
例如:
classpath 'com.android.tools.build:gradle:6.1.0'
Edit it with Android Studio then click Sync now使用 Android Studio 对其进行编辑,然后单击立即同步
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.