Not signed in
Copyright © 2026 Unity Technologies
Unfortunately, it is a known limitation of the build pipeline today: project settings that can impact both editor and standalone player code are set atomically, to avoid situations where the editor code used in the batch has different define symbols / build targets defined as in the standalone player they are building. In non-batch mode, it is usually not an issue, as changing such a setting triggers a rebuild on next frame, so when you actually build the standalone player, your editor code is already running with the correct buildtarget / define symbols. To workaround this, most of our CI scripts that build standalone players are actually written with 2 batch invocations: - 1st one configure the projects (sets define symbols, build target, scripting backend etc.) - 2nd only runs the player build The rationale here, is that we have customers who have define symbols that both impact their build script code and the runtime code produced in players. Somehow, we need to keep them in sync.
Steps to reproduce:
1. Open the attached user's project "define-symbols-bug.zip"
2. Add the project as a local repository on Github
3. Perform an initial commit of the project files
4. Run this command in Command Prompt: Unity.exe -quit -batchmode -nographics -projectPath "PATH" -buildTarget Android -executeMethod Bar.BuildWithoutFoo -logfile log1.txt
5. To confirm that the build actually happened, check the "Out" Folder in the project directory to see the built APK
6. In Github dekstop app check and see if the FOO define symbol attribute was removed from the ProjectSettings file
7. Type "git reset --hard" in CMD in your root project folder
8. Go into your project directory and modify "Assets/Code/CodeEditor/Bar.cs" (add empty lines) to force its recompilation
9. Repeat step 4 again and see that the batch build failed
Expected results: batch build doesn't fail
Actual results: batch build fails
Reproducible on: 2020.3.44f1
Not reproducible on: 2021.3.17f1, 2022.2.3f1, 2023.1.0a25
Notes:
Sign in to see your voted issues