4

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.)

lendo
  • 190
  • 2
  • 10

2 Answers2

9

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.

lendo
  • 190
  • 2
  • 10
  • 3
    April 2022: this issue is still resolve using JDK 16. I'm using windows so my path is `org.gradle.java.home=C:\\Program Files\\Java\\jdk-16.0.2` – ymz Apr 28 '22 at 15:56
  • on the official page, it says JDK 16 has been suspended, https://jdk.java.net/16 i guess the second answer should be the most recent accepted answer – Buchi Dec 12 '22 at 14:51
1

Alternative solution that worked for me was to update gradle to 7.4.2.

jamsandwich
  • 367
  • 5
  • 11