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.