Search Issue Tracker
By Design
Votes
6
Found in
2018.4
2019.2.19f1
2020.2
Issue ID
1223602
Regression
No
IPostprocessBuildWithReport.OnPostprocessBuild function is not called when the Build fails
How to reproduce:
1. Open the attached project
2. In the Project Window, open the "NewBehaviourScript" located in the Assets folder
3. In the Script, uncomment the 6th line of code
4. Build the project
Expected result: OnPostprocessBuild function is called when the Build fails
Actual result: OnPostprocessBuild function is not called when the Build fails
Reproducible with: 2018.4.19f1, 2019.3.4f1, 2020.1.0b1, 2020.2.0a2
Couldn't test with: 2017.4.37f1 (IPostprocessBuildWithReport does not exist)
-
enfort
Apr 22, 2024 14:08
This design is wrong. A project might have multiple pairs of IPreprocessBuildWithReport and IPostprocessBuildWithReport which setup something like preloaded assets (these assets are selected according to projection conditions) and expect to dismantle these setup safely whatever the build result is.
-
Atomiz2002
Jan 04, 2024 13:26
Reconsider. The thread above is a pretty strong argument against this decision by your design.
-
Wriggler
Nov 01, 2023 10:19
This is the wrong decision. As users of Unity, we don't want to care about the inner workings of the build system and the concerns of whether it needs to early out or not. We want a simple, consistent API which gets called when the build starts, and when the build finishes (regardless of its success/failure status). We're obviously building more complexity on top of these APIs, and they need to be really reliable as to when they're actually called. The current system has these weird edge cases which just make our job harder than it needs to be. Please consider changing this.
-
roberto_sc
Sep 24, 2021 11:20
If this is by default, then what is BuildReport.summary.result.Failed used for?
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
- A Console error is not handled correctly when using #pragma kernel with the Kernel name not provided
- L(a,b) expression in float fields has erratic behaviour when ordering due to using instanceID as an index
- SubMesh GameObject duplicates and warning is logged to console when trying to undo failed deletion
- InvalidOperationException is thrown when switching to a custom Debug Draw Mode in Scene View
- [Android][Vulkan] Skybox and Environment effects flicker in the Player when using the Vulkan Graphics API
Resolution Note:
The build has failed and we stop all processing as quickly as possible to return control of the editor back to the user. This includes further processing of build callbacks that have yet to be called for this build.