React Native应用程序未运行Gradle插件问题

mpgws1up  于 2023-03-23  发布在  React
关注(0)|答案(1)|浏览(234)

不支持Gradle插件版本。由于某些原因,应用程序未运行
我的gradle版本是7.5.1,但是,在
android/gradle-properties文件,

distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip

在我的android/build.gradle

buildscript {
    ext {
        uildToolsVersion = "33.0.0"
        minSdkVersion = 21
        compileSdkVersion = 33
        targetSdkVersion = 33
        // We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
        ndkVersion = "23.1.7779620"
    }
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath("com.android.tools.build:gradle:7.3.1")
        classpath("com.facebook.react:react-native-gradle-plugin")
    }
}

这是我用npm run android运行应用程序时发生的错误

Configure project :react-native-reanimated
No AAR for react-native-reanimated found. Attempting to build from source.
Android gradle plugin: 7.3.1
Gradle: 7.5.1
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.
WARNING:The specified Android SDK Build Tools version (29.0.2) is ignored, as it is below the minimum supported version (30.0.3) for Android Gradle Plugin 7.3.1.
Android SDK Build Tools 30.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '29.0.2'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
WARNING:The specified Android SDK Build Tools version (28.0.3) is ignored, as it is below the minimum supported version (30.0.3) for Android Gradle Plugin 7.3.1.
Android SDK Build Tools 30.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '28.0.3'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
WARNING:The specified Android SDK Build Tools version (27.0.3) is ignored, as it is below the minimum supported version (30.0.3) for Android Gradle Plugin 7.3.1.
Android SDK Build Tools 30.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '27.0.3'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.

> Task :app:checkDevelopmentDebugAarMetadata FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings
26 actionable tasks: 21 executed, 5 up-to-date
Picked up _JAVA_OPTIONS: -Xmx1024M

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:checkDevelopmentDebugAarMetadata'.
> Could not resolve all files for configuration ':app:developmentDebugRuntimeClasspath'.
   > Failed to transform react-android-0.71.3-debug.aar (com.facebook.react:react-
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
java.lang.StackOverflowError (no error message)

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

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

BUILD FAILED in 27s

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.bat app:installDevDebug -PreactNativeDevServerPort=8081
Picked up _JAVA_OPTIONS: -Xmx1024M

BUILD FAILED in 27s

    at makeError (C:\nk-bk-hool\hoolapp\node_modules\execa\index.js:174:9)
    at C:\nk-bk-hool\hoolapp\node_modules\execa\index.js:278:16
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async runOnAllDevices (C:\nk-bk-hool\hoolapp\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:82:7)
v1uwarro

v1uwarro1#

这一行好像少了一个字母b``uildToolsVersion = "33.0.0"
应该是buildToolsVersion = "33.0.0"

相关问题