typescript - react-native run-android 出现错误 : A problem occurred evaluating project ':app' . ([androidx.appcompat :appcompat:1. 1.0-rc01])

标签 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 原生:0.61.1

  • 注: 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/

    相关文章:

    android - dialogCornerRadius,fontVariationSettings,ttcIndex ...安装和链接依赖项到我的应用程序后找不到

    reactjs - rowHasChanged Undefined 不是构造函数

    groovy - 如何递归打印gradle配置?

    android - 通过Gradle签名APK-特殊字符的无效编码

    javascript - 数组填充后如何加载页面?

    git - 写库的时候,是不是应该把TypeScript生成的JavaScript文件放到gitignore里面?

    generics - 泛型类、约束和继承

    Typescript 重构 switch 语句

    android - 应用程序仅在真实设备上崩溃 | react 原生 |世博会

    android - 在Android Studio中运行Android App:无法创建 keystore