Symptoms:
- My builds are failing in Unity Build Automation (UBA), but I'm not sure why.
- Builds work locally but not in Unity Build Automation.
Cause:
While there are many potential causes for build failures, the most common are:
- Version Control issues.
- Script compilation errors.
- Platform-specific issues (for example, iOS or Android credentials, Xcode build failures, Android tools errors, etc.).
- System memory limits, the worker runs out of RAM, and the OS terminates the process.
Resolution:
While a specific resolution will be tied to the actual cause of the build failure, these are often the first steps in isolating the cause and fixing the issue:
- Examine your build logs:
- Accessible from the Build History right sidebar, the Full Build log often provides a clear picture of the cause of the build failure. Compact logs can be a quick, effective way to search for issues, but beware of false positives: any line with the text "warning" or "error" is often tagged even if it is not representative of an error.
- If the build fails in the checkout phase, the issue is most likely with the version control configuration. Confirm your settings and try re-entering/refreshing your credentials.
- If you see "Player Export Failed" in the build logs, it means the Editor build failed, and you should find further information just before it explaining why. The most common issue here is script compilation errors.
- If the issue is specifically with the Xcode/Android portion of a build for those platforms, look for stack traces and error messages around the point of failure in the logs. For Xcode build failures, you can also access Xcode archive logs from the side menu in the Build History.
- Running portions of the build logs through AI tools (while being conscious of confidential information) can also help identify the cause of failure.
- Accessible from the Build History right sidebar, the Full Build log often provides a clear picture of the cause of the build failure. Compact logs can be a quick, effective way to search for issues, but beware of false positives: any line with the text "warning" or "error" is often tagged even if it is not representative of an error.
- Attempt your build locally in batch mode from a clean pull of the repository:
- UBA builds your project in batch mode on virtual builders. Ensuring that this process works locally, where you have much more control over the environment, is an important first step in isolating the cause of the build failure.
- If the build fails in batch mode locally, the first step is to resolve any issues locally before attempting to build in UBA.
- Try using a different builder type:
- If you see from the logs that the builder is either stalling (build canceled) or crashing during the build (often indicated by memory-related errors), you should try changing the builder type to a premium builder with more memory/resources or a GPU.
In some cases, Premium builders can process the build much faster, resulting in fewer billable minutes being consumed.
- If you see from the logs that the builder is either stalling (build canceled) or crashing during the build (often indicated by memory-related errors), you should try changing the builder type to a premium builder with more memory/resources or a GPU.
Additional Information:
Git - Maximum retires exceeded