Android build fails in Unity Build Automation
Resolve Android build failures in Unity Build Automation and identify common causes.
Read time 1 minuteLast updated 16 hours ago
Symptoms
- Android builds fail for an unclear reason.
- Android builds fail and other targets build correctly.
- Android builds fail in UBA but work locally.
Cause
Unity Build Automation runs the Unity Editor inbatchmodeGradle Build failedResolution
The first step to resolve this issue is to ensure you can build your project locally in batch mode with the following tool versions:- The Unity Editor.
- The JDK (the default version that ships with the chosen version of the Editor).
- The Android SDK (either the default version or as specified in your advanced target configuration).
If your project does build locally, take note of the versions of the tools you used and ensure they match with the versions you use in the Unity Build Automation service. To check your local version of Gradle you can use the command
gradle --versionbatchmode