我使用 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
版本:
注: bash_profile 中的环境变量已设置。
我也尝试删除 node_module 并运行 yarn 但没有成功
最佳答案
转至 android/app/build.gradle
,在依赖项中使用它:
implementation 'androidx.appcompat:appcompat:1.1.0-rc01'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0-alpha02'
关于typescript - react-native run-android 出现错误 : A problem occurred evaluating project ':app' . ([androidx.appcompat :appcompat:1. 1.0-rc01]),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58109155/