react-native运行android出现错误:评估项目':app'时出现问题。([androidx.appcompat:appcompat:1.1.0-rc01])

时间:2019-09-26 03:25:11

标签: typescript react-native gradle react-native-android

我通过使用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

版本:   “ react”:“ 16.9.0”,     “ react-native”:“ 0.61.1”,

注意:bash_profile中的环境变量已设置。 我也试图删除node_module并运行yarn但没有成功

感谢进阶

1 个答案:

答案 0 :(得分:0)

转到android / app / build.gradle,在依赖项中使用它:

implementation 'androidx.appcompat:appcompat:1.1.0-rc01'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0-alpha02'