Unsupported class file major version 61

Hello, I have an Ionic Cordova Angular project. I received an email from Google asking me to target Android 14 (API 34), so I tried to do this by updating android-targetSdkVersion to 34 and cordova-android to version 13.0.0 (Cordova Android 13.0.0 Released! - Apache Cordova).

Unfortunately, I’m still stuck with this error message when I try to build for Android:

Reading build config file: C:\workspace\ant\dev\build.json

FAILURE: Build failed with an exception.

* Where:
Settings file 'C:\workspace\ant\dev\platforms\android\tools\settings.gradle'

* What went wrong:
Could not compile settings file 'C:\workspace\ant\dev\platforms\android\tools\settings.gradle'.
> startup failed:
  General error during semantic analysis: Unsupported class file major version 61

  java.lang.IllegalArgumentException: Unsupported class file major version 61

I’m using Java 17; I tried with Java 16, but the error message is still there (except it says 60 instead of 61). I’m at a loss and don’t know what to do anymore.

When I open Android Studio, I see two gradle-wrapper.properties files (android/gradle/wrapper/gradle-wrapper.properties and android/app/gradle/wrapper/gradle-wrapper.properties) with distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip.

Do you have any idea how to solve my problem?
Any help would be appreciated. Thank you!