Closed JoraSN closed 9 months ago
Gradle doesn't support java 20. Gradle 8 itself supports up to java 19.
However, cordova android is using Android Gradle Plugin 7.4.2/ gradle 7 which is intended to be ran with java 11. Java 11 would be the current recommended version to use.
Bug Report
Problem
What is expected to happen?
I expected to build and run my Cordova project on Android using the command
cordova run android --target=Pixel_3a_API_33_x86_64
successfully.What does actually happen?
Instead, I encountered the following error during the build process:
Information
The error message mentions an unsupported class file major version 64. I am using Cordova version 12.0.0 with Cordova Android platform version 12.0.0. The Gradle version on my system is 8.2.1, and I have Java version 20.0.1 set up.
Command or Code
To reproduce the issue, make a new Cordova project, add android as a platform and run the following command in the command prompt or terminal:
With "Pixel_3a_API_33_x86_64" being the name of your emulator.
Environment, Platform, Device
I am experiencing the issue on a Windows 11 machine.
Version information
Cordova CLI version: 12.0.0 Cordova Android platform version: 12.0.0 Gradle version: 8.2.1 Java version: 20.0.1 Operating System: Windows 11
Checklist