[英]Unsupported class file major version 61 Cordova Mac
So im on mac (Big sur), and i wish to build a Cordova app to android. I have java 17 installed, and gradle 7.1.1 .所以我在 mac(Big sur)上,我希望为 android 构建一个 Cordova 应用程序。我安装了java 17和gradle 7.1.1 。
Im able to build the project on another windows computer just fine.我能够在另一台 windows 计算机上构建项目就好了。 (though i cannot rely on that for personal reasons)
(尽管出于个人原因我不能依赖它)
But every time i try to build on mac, im confronted with following error:但是每次我尝试在 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
(There is more to the error but its long. Will provide if needed.) (错误更多,但它很长。如果需要会提供。)
Answered by @JustInCoding, the solution for me was to install JDK 16 , and then add org.gradle.java.home=your Jdk 16 path here
in the gradle.properties
file of my project. @JustInCoding 回答,我的解决方案是安装 JDK 16 ,然后添加
org.gradle.java.home=your Jdk 16 path here
in the gradle.properties
file
Alternative solution that worked for me was to update gradle to 7.4.2.对我有用的替代解决方案是将 gradle 更新到 7.4.2。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.