Android Gradle build failed: compileReleaseJavaWithJavac

Hey folks, I’m getting errors trying to build my Android game and I’m quite perplexed.

My game is currently on the Play store. Since that last submission, I’ve made many changes just to the game itself (new scripts, new models, new textures, etc). As per an e-mail from Facebook, there was an issue apparently with my logging in sequence, so I updated to the latest Facebook SDK (version 11.0.0). I haven’t made an android build in a few months, but when I attempted to make a build I got gradle errors of which I couldn’t resolve going over all of the various suggestions on the forums.

I decided to revert my project to before this Facebook SDK update, and I’m getting Gradle errors again. My project, outside of the game-specific updates, is exactly the same yet now I get errors trying to build it.

Any help would be immensely appreciated, I really don’t want to have to just remove Facebook linking because I get errors I can’t troubleshoot.

stderr[
An exception has occurred in the compiler (1.8.0-adoptopenjdk). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program and the following diagnostic in your report. Thank you.
java.lang.AssertionError: annotationType(): unrecognized Attribute name MODULE (class com.sun.tools.javac.util.UnsharedNameTable$NameImpl)
at...
at...
...

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileReleaseJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

Ok, I launched Android Studio, opened the SDK manager and installed 30.0.2 build tools. That seems to have fixed the problem. I don’t know why, I don’t know what’s changed, but it now works. Hopefully that helps someone else in the future.