unrecognized Attribute name MODULE (class com.sun.tools.javac.util.SharedNameTable$NameImpl)

This arises in Android builds from a combination of:

  • Using compileSdkVersion 31 (or maybe later),
  • With JDK8,
  • Having any Lambda style related code somewhere (else error may not happen).

The default android toolchains have moved to JDK11 now, you must use JDK11, at least if you change any of the Android API target versions to 31 (or later).


Path to update your gradle jdk in AS Arctic Fox:

Settings > Build, Execution, Deployment > Build Tools > Gradle > Gradle JDK

Select 11 and build should be successful.

Leave a Comment