在Android上构建ionic“无法编译设置文件'***/platforms/android/settings. gradle'”[重复]

neskvpey  于 2022-12-09  发布在  Ionic
关注(0)|答案(1)|浏览(318)

此问题在此处已有答案

How can I fix "unsupported class file major version 60" in IntelliJ IDEA?(13个答案)
Android Studio Error "Unsupported class file major version 61"(3个答案)
6个月前关闭。
我尝试在Mac上的Visual Studio中构建Android上的离子应用程序,但我收到此错误:

sudo ionic cordova build android  --warning-mode=all

错误:

FAILURE: Build failed with an exception.        
    * Where:
    Settings file '/Users/**/platforms/android/settings.gradle'
    * What went wrong:
    Could not compile settings file '/Users/**/platforms/android/settings.gradle'.
    > startup failed:
    General error during conversion: Unsupported class file major version 62
    java.lang.IllegalArgumentException: Unsupported class file major version 62 

BUILD FAILED in 1s
Command failed with exit code 1: /**/platforms/android/gradlew cdvBuildDebug -b /**/platforms/android/build.gradle
[ERROR] An error occurred while running subprocess cordova.

我使用过的版本:

  1. ./gradlew wrapper version= 7.3.1
  2. gradle version= 7.3.1
  3. java version= 11.0.15.1
    来自android studio的Info.plist文件:
    JVMVersion= 11.0.12
dfddblmv

dfddblmv1#

不支持的类文件主版本62表示Java 16尚不受支持。请尝试Java 8或11(例如Android Studio的捆绑版本),方法是编辑文件gradle.properties并添加org.gradle.java.home=you'r 11 java路径

相关问题