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"

Deployment Management

-

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

  1. 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.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.