I'm sorry, I couldn't come up with a better title. I have no idea why build started to fail because I didn't change anything, at least I didn't notice. Maybe I could have accidentally changed Player settings. Here are the errors. Sorry about the wall of text. If you don't know from the errors which might be the case, can I easily backup Player or build settings by copying a file or directory?
Do you use a custom Android SDK (specified in editor's preferences -> external tools). The error that you get seems to be an incompatibility between openjdk-1.8 (used in Unity by default) and some of Android SDK components. Using the Android SDK version installed by the Unity Hub should solve this particular issue.
I'm running into the same issue. I've upgraded from 2019.4.17f to 2020.3.18f. I haven't been able to build since I started to target Android API 31.
Please check if your issue is not discussed in this thread https://forum.unity.com/threads/gradle-build-fails-with-build-tools-31-0-0.1154834/
Hi @JuliusM, it does not appear to be the same issue. I currently use the Gradle version installed with Unity, which is 6.1.1.
Yes, that issue discussed in the linked thread is about Android SDK component versions, not about the custom Gradle version. To rephrase that thread, if you have updated your Android SDK build-tools to version 31, then the build will fail with default Gradle versions included in Unity 2020LTS and newer versions. If that is not your issue, please post the specific error messages you get when the build fails.