Android Build Fail, CommandInvokationFailure

I don’t know why, but lately, I can’t even build an empty project for Android. Whenever I build, I get these errors:

I’ve tried using different Gradle versions, SDK, and JDK.

Alright, so I managed to solve it by changing the Target API Level from Highest to Android 11.