繁体   English   中英

不支持 class 文件主要版本 61 Cordova Mac

[英]Unsupported class file major version 61 Cordova Mac

所以我在 mac(Big sur)上,我希望为 android 构建一个 Cordova 应用程序。我安装了java 17gradle 7.1.1

我能够在另一台 windows 计算机上构建项目就好了。 (尽管出于个人原因我不能依赖它)

但是每次我尝试在 mac 上构建时,我都会遇到以下错误:

FAILURE: Build failed with an exception.

* Where:
Settings file '/Users/me/app/cordovaProject/platforms/android/settings.gradle'

* What went wrong:
Could not compile settings file '/Users/me/app/cordovaProject/platforms/android/settings.gradle'.
> startup failed:
  General error during conversion: Unsupported class file major version 61

(错误更多,但它很长。如果需要会提供。)

@JustInCoding 回答,我的解决方案是安装 JDK 16 ,然后添加org.gradle.java.home=your Jdk 16 path here in the gradle.properties file

对我有用的替代解决方案是将 gradle 更新到 7.4.2。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM