【问题标题】:I am using react native and when I run my project using npx react-native run-android, I got this error我正在使用 react native,当我使用 npx react-native run-android 运行我的项目时,出现此错误
【发布时间】:2021-06-11 12:08:51
【问题描述】:

FAILURE:构建失败并出现异常。

  • 在哪里: 设置文件 'D:\React Native\contacts\android\settings.gradle'

  • 出了什么问题: 无法编译设置文件 'D:\React Native\contacts\android\settings.gradle'。

启动失败: 语义分析期间的一般错误:不支持的类文件主要版本 60

在我的 settings.gradle 中

rootProject.name = 'contacts'
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'

【问题讨论】:

    标签: android react-native


    【解决方案1】:

    我遇到了同样的错误,对我来说这是有效的:

    第一次运行:npm i @react-native-community/cli-platform-android

    第二次运行:npm install

    【讨论】:

      猜你喜欢
      • 2020-07-27
      • 2022-12-06
      • 1970-01-01
      • 1970-01-01
      • 2021-07-05
      • 2021-10-14
      • 2020-01-23
      • 2018-07-07
      • 1970-01-01
      相关资源
      最近更新 更多