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
- Crash on RaiseException when opening a specific project
- DownloadHandlerScript.CompleteContent is called twice when building for WebGL
- Scene view has Y coordinates of the Screen Position node flipped when some of the URP features are disabled
- Volumetric fog shader variants are missing from build when "Strict Shader Variant Matching" is disabled
- Unnecessary modifications clutter the Scene when using a RectTransform driven by a LayoutGroup in a Prefab
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.