从React Native .67.5升级到.68.6 - Android Bundle Release失败Java 1.8 vs 1.11

3htmauhk  于 2023-04-04  发布在  Android
关注(0)|答案(1)|浏览(97)

我已经使用React Native Upgrade Helper进行了升级- Android应用正在本地构建,但在使用cd android的管道中失败。/gradlew bundleRelease
我在本地安装了1.11 java。Android Studio gradle也指向了1.11

Note: /Users/runner/work/1/s/node_modules/react-native-gradle-plugin/src/main/java/com/facebook/react/codegen/generator/SchemaJsonParser.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

> Task :react-native-gradle-plugin:pluginDescriptors
> Task :react-native-gradle-plugin:processResources
> Task :react-native-gradle-plugin:classes
> Task :react-native-gradle-plugin:inspectClassesForKotlinIC
> Task :react-native-gradle-plugin:jar

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/runner/work/1/s/android/app/build.gradle' line: 1

* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin 'com.android.internal.application'.
  > Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.
    You can try some of the following options:
      - changing the IDE settings.
      - changing the JAVA_HOME environment variable.
      - changing `org.gradle.java.home` in `gradle.properties`.```
bjp0bcyl

bjp0bcyl1#

这是一个Azure管道问题。
有一个Java工具安装程序插件没有被利用。
添加YAML如下:

- task: JavaToolInstaller@0
  displayName: 'Use Java 11'
  inputs:
    versionSpec: 11
    jdkArchitectureOption: x64
    jdkSourceOption: PreInstalled

相关问题