Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UnsupportedClassVersionError while 'flutter doctor --android-licenses' MacOS

System Settings:

  • MacOS Ventura

  • Android Studio Electric Eel

I am installing Flutter on my Intel Mac.

After Running flutter doctor

The outcome is this:

[✓] Flutter (Channel stable, 3.7.0, on macOS 13.2 22D49 darwin-x64, locale
    en-MX)
[!] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for
      more details.
[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.1)
[✓] VS Code (version 1.74.3)
[✓] Connected device (2 available)
[✓] HTTP Host Availability

and after running flutter doctor --android-licenses the outcome is this:

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 installed Java for Mac from this link on January 2023 from Here

Has someone encountered the same error? How did you fix it?

like image 350
Pasdian Avatar asked Aug 30 '25 17:08

Pasdian


1 Answers

I will try to give a more detailed solution:

  1. Install the latest version of the Java SDK from this link
  2. Pick Java 19 and the x64 DMG Installer (this worked for me)
  3. Follow the installation instructions.
  4. [optional] If necessary, set your JAVA_HOME path following these instructions (mac)
  5. Test the installation by running flutter doctor --android-licenses
like image 84
Tomas Ward Avatar answered Sep 02 '25 05:09

Tomas Ward