Mac user (2019.2.9f1) "CommandInvokationFailure: Gradle build failed."

I have spent days trying to track this down and nothing helps, the Android Build just fails (iOS builds fine). I’m a MAC user and most of the help is from Windows users so finding some of their fixes is a bit tedious, but I have tried them all.

I use the Android SDK and NDK installed with unity and I even updated Java (not needed) because another user somewhere recommended that. I am not using Unity Ads (another past problem I read somewhere). I have reinstalled everything twice, tweaked the “Other Settings” more that that, and bounced around “Preferences/External Tools” more than a few times, following advice from others using earlier versions of Unity.

Here’s where it crashes at:

CommandInvokationFailure: Gradle build failed.
/Applications/Unity/2019.2.9f1/PlaybackEngines/AndroidPlayer/Tools/OpenJDK/MacOS/bin/java -classpath “/Applications/Unity/2019.2.9f1/PlaybackEngines/AndroidPlayer/Tools/gradle/lib/gradle-launcher-5.1.1.jar” org.gradle.launcher.GradleMain “-Dorg.gradle.jvmargs=-Xmx4096m” “assembleRelease”

Any help from anyone would be great.

The log should have more than that. Often gradle outputs “what went wrong” or “stderr”, try to look for those.

Hello! There is an active issue that some Gradle builds fail on AndroidX - more information: Unity Issue Tracker - [Android] Gradle build fails with AndroidX libraries