Search Issue Tracker
By Design
Votes
0
Found in
2018.2.0b2
2018.2.18f1
Issue ID
1107875
Regression
Yes
[Build Callbacks] OnPreprocessBuild of IPreprocessBuildWithReport is not called when clicking "Build" instead of "Build And Run"
Steps to reproduce:
1. Open attached project
2. Press "Build And Run"
3. Observe that "Error building Player: Exception: hi" is thrown
4. Press "Build"
- Only the following exception is printed:
Exception: hi
MyBuildProcessor.OnPreprocessBuild (UnityEditor.Build.Reporting.BuildReport report) (at Assets/MyBuildProcessor.cs:10)
...
Expected result: "Error building Player: Exception: hi" should be thrown after pressing "Build"
Reproduced in: 2019.1.0a13, 2018.2.18f1, 2018.2.0b2
Not reproduced in: 2018.2.0b1, 2018.2.0a9
Regression since: 2018.2.0b2
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
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
Resolution Note:
Throwing a generic exceptions in build callbacks do not fail the "Build" but do fail the "Build And Run". This is intended as "Build" does not use the BuildOptions.StrictMode to build while "Build And Run" does. Using BuildFailedException is the correct way to fail a build from a callback. Note: related case 1097286 about BuildFailedException.