Home > Back-end >  UnsupportedClassVersionError while 'flutter doctor --android-licenses' MacOS
UnsupportedClassVersionError while 'flutter doctor --android-licenses' MacOS

Time:01-26

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?

Thanks.

CodePudding user response:

Found the solution.

I needed to update the JDK from here.

CodePudding user response:

What exactly did you do? I have the same issue and tried different JDK versions, including the ones you linked. I am on Apple Silicon. Is there a way to completely reset the flutter config? Seems like the JDK via Android Studio somehow messed up the flutter setup...

  • Related