我使用 react-native init 创建了一个新项目,但我收到以下错误
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/vahiddavoudi/Project/BBW/android/app/build.gradle' line: 202
* What went wrong:
A problem occurred evaluating project ':app'.
**Could not find method implementation() for arguments [androidx.appcompat:appcompat:1.1.0-rc01] on project ':app' of type org.gradle.api.Project.**
* 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 1s
error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#andr
oid-development-environment. Run CLI with --verbose flag for more details.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
版本:
- 反应:16.9.0
- 反应原生:0.61.1
注意:bash_profile中的环境变量是设置的。 我也尝试去除node_module并运行纱线,但没有成功
转到android/app/build.gradle
,在依赖项中使用它:
implementation 'androidx.appcompat:appcompat:1.1.0-rc01'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0-alpha02'