Error: LinkageError occurred while loading main class

2.7k Views Asked by At

I have just try to execute below command in Android Studio Terminal:

flutter doctor --android-licenses

and getting below error:

Error: LinkageError occurred while loading main class com.android.sdklib.tool.sdkmanager.SdkManagerCli java.lang.UnsupportedClassVersionError: com/android/sdklib/tool/sdkmanager/SdkManagerCli has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0

What might be the issue? and How can resolve this?

1

There are 1 best solutions below

0
Marcio LSA On

The (class file version 61.0) is JDK 17. Upgrade your JDK to 17 and make sure it is on your PATH using java --version on a new terminal or after reloading env variables.