【问题标题】:[React Native][0.71] Plugin with id 'com.facebook.react' not found[React Native][0.71] 找不到 id \'com.facebook.react\' 的插件
【发布时间】:2023-02-11 03:29:15
【问题描述】:

找不到 ID 为“com.facebook.react”的插件。

1:任务因异常而失败。

  • 在哪里: 构建文件“android/app/build.gradle”行:2

  • 什么地方出了错: 评估项目“:app”时出现问题。

找不到 ID 为“com.facebook.react”的插件。

==============================================================================

* Get more help at https://help.gradle.org

BUILD FAILED in 3s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* Where:
Build file 'android/app/build.gradle' line: 2

* What went wrong:
A problem occurred evaluating project ':app'.
> Plugin with id 'com.facebook.react' not found.

* 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 ':app'.
> compileSdkVersion is not specified. Please add it to build.gradle

* 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

【问题讨论】:

    标签: android react-native build.gradle


    【解决方案1】:

    解决方案

    android/build.gradle依赖中添加classpath("com.facebook.react:react-native-gradle-plugin")

    【讨论】:

      【解决方案2】:

      【讨论】:

        猜你喜欢
        • 2023-02-21
        • 2022-10-13
        • 2023-02-10
        • 2023-02-03
        • 2019-05-27
        • 1970-01-01
        • 2020-01-11
        • 2020-04-28
        • 2022-08-02
        相关资源
        最近更新 更多