Unsupported class file major version 61 error

Based on the answer of DeveloperOmar 100 I found the following solution:

  1. switch your Java version to a compatible version, in my case to Java version 16.0.2

    To switch it you have to set your PATH. (e.g for Mac, you can use the java_home command).

  2. check your Gradle version and update that one too, so it is compatible (see the Gradle wrapper docs) so in my case I had to change the distributionUrl property in android/gradle/wrapper/gradle-wrapper.properties:

    distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip
    

Leave a Comment