Search Issue Tracker
By Design
Votes
3
Found in
2019.4
2020.3
2020.3.11f1
2021.1
2021.2
2022.1
Issue ID
1346916
Regression
No
Player crashes after removing a used Define symbol when built via Command line
How to reproduce:
1. Open the attached "case_1346916.zip" project
2. Navigate to Edit/Project Settings/Player/Other Settings/Script Compilation and type "DISABLEINSTANTIATING" in the input field
3. Apply the changes and close the project
4. In the File Explorer, open the %ProjectRoot/Build.bat file with the text editor and insert the correct project path
5. Run the Build.bat file
6. Launch the Player once it's built
Expected result: Player is launched
Actual result: Player crashes
Reproducible with: 2019.4.29f1, 2020.3.14f1, 2021.1.15f1, 2021.2.0b5, 2022.1.0a2
Could not test with: 2022.1.0a3 (build fails)
Notes:
1. Player does not crash if built through the Editor
2. Player does not crash if Define is not removed
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- “Remove Unused Overrides” available on not loaded Scene and throws “ArgumentException: The scene is not loaded” warning
- Adaptive Probe Volume occlusion edge is calculated incorrectly when viewing probes near geometry edges
- Sampling a texture using an HLSL file throws shader errors and the code does not compile
- "Graphics.CopyTexture called with null source texture" error when Base Camera of an Overlay Camera is removed with DX11 Graphics API and Compatibility Mode enabled
- WebGL sends wrong value with large numbers when SendMessage function is used
Resolution Note (2022.1.X):
The current behaviour is actually a "By Design" limitation of the scriptable BuildPipeline:
- define symbols apply to both editor code (such as the PerformJenkinsBuild.cs script in that particular case) and player code
- in most of cases, we want to built player to be aligned with what precompilation symbols were used to compile the editor script triggering the build (and that is what the BuildPipeline.BuildPlayer does)
So in that case, the workaround is to split the build scripts in 2 invocations, so that the editor code gets rebuilt with the required define changes before invoking the player build.
We are aware that this behaviour is not documented and have created a ticket to improve documentation on BuildPipeline.BuildPlayer behaviour towards PlayerSettings that can affect both editor and player build.