Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

IPostprocessBuildWithReport doesn't trigger if build errors out

Discussion in 'Testing & Automation' started by Solovykh, Mar 6, 2020.

  1. Solovykh

    Solovykh

    Joined:
    Aug 28, 2017
    Posts:
    59
    Hey there,

    Is it a known issue that IPostprocessBuildWithReport's OnPostprocessBuild doesn't get run if the build errors out?
     
  2. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,555
    Is this question related to testing and automation? in any case, i believe you should always get a callback, even when the build fails (the BuildReport object should contain information about the failure).
     
  3. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,009
  4. Solovykh

    Solovykh

    Joined:
    Aug 28, 2017
    Posts:
    59
  5. v01pe_

    v01pe_

    Joined:
    Mar 25, 2015
    Posts:
    70
    As the issue was resolved as `By Design`, I researched for alternatives/ workarounds and found a thread, that describes the story behind all this - thanks @bdovas for initiating the discussion. I went ahead and implemented a custom `BuildHandler` script as a workaround.
     
    florinel2102 and Max_Aigner like this.
  6. florinel2102

    florinel2102

    Joined:
    May 21, 2019
    Posts:
    75
    Woth mentioning to add #if UNITY_EDITOR at the beginning of the script . Thanks !