当前位置:   article > 正文

react-native Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081_error failed to install the app. command failed wi

error failed to install the app. command failed with exit code 1: gradlew.ba

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 failed with an exception.

  • What went wrong:
    Could not open settings generic class cache for settings file ‘/Users/jack/Desktop/study/test1/android/settings.gradle’ (/Users/jack/.gradle/caches/7.5.1/scripts/15aifqr1b78gnkskj70b58ki).

BUG! exception in phase ‘semantic analysis’ in source unit ‘BuildScript’ Unsupported class file major version 63

  • 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 2s

java 19

需要更新gradle到7.6. 只有7.6才适配了java19
需要更新gradle到7.6. 只有7.6才适配了java19
需要更新gradle到7.6. 只有7.6才适配了java19

解决方案

修改俩个文件
在这里插入图片描述
在这里插入图片描述

然后./gradlew wrapper --version-7.6.1 也可不用 直接 npm run android

本文内容由网友自发贡献,转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/841794
推荐阅读
相关标签
  

闽ICP备14008679号