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.
Im able to build the project on another windows computer just fine. (though i cannot rely on that for personal reasons)
But every time i try to build on mac, im confronted with following error:
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.