Home > Enterprise >  Android Studio Error "Unsupported class file major version 61"
Android Studio Error "Unsupported class file major version 61"

Time:01-09

I moved my Android Studio project from one computer to another and now I get the error:

"Unsupported class file major version 61" .

enter image description here

How could I fix this?

CodePudding user response:

class file major version 61 means that the class file you are trying to load has been compiled by Java 17 (and for Java 17 only).

The Android toolchain only support only classes compiled for Java 11 (if the project is properly configured). So there is something wrong with the library you are trying to load.

As you don't give any details in your question what you are trying to do it is impossible to give you a more detailed answer.

CodePudding user response:

Thanks to @Robert I found out that the problem was with JAVA 17 and that the Gradle JDK in use was:
Android Studio java home version 17.0.1

I changed it to:
Android Studio default JDK version 11.0.10

enter image description here

Then everything worked like before...

You'll find the Gradle Settings under File > Project Structure...
enter image description here

...or through the Toolbar button: Project Structure...
enter image description here

Then click the Gradle Settings link. enter image description here

  •  Tags:  
  • Related