I am trying to accept flutter doctor --android-licenses but I am getting this error:
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/android/prefs/AndroidLocationsProvider has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
I'm on MacOS Ventura. I installed Android Studio today. This is how I solved the problem:
cd /Applications/Android\ Studio.app/Contents/jbrln -s ../jbr jdkln -s "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin" jdkflutter doctor againflutter doctor --android-licenses.I was able to agree to the licenses successfully after.
All the steps are also mentioned here and here
I've had the same error, I haven't specify JAVA_HOME env, and flutter used my 1.8 java.
For macOS: Check your JAVA_HOME env in terminal with
printenv
if env not existed, list installed java version
/usr/libexec/java_home -V
choose one and execute
export JAVA_HOME=$(/usr/libexec/java_home -v"YOUR_VERSION")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With