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

Cant get ICustomBootstrap to work in build

Discussion in 'Entity Component System' started by Wobbers, Sep 12, 2020.

  1. Wobbers

    Wobbers

    Joined:
    Dec 31, 2017
    Posts:
    55
    So after a few hours of trying to get my project to build properly, I found that the reason it is not working is my ICustomBootstrap.Initialize is not called.

    Not sure if I am missing something, I tried adding a DotsRuntimeBuildProfile step to my build pipeline, because the name sounds promising, but I can't find any documentation on it.
    I can't add it though, because if I try, it will throw an error:
    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. Unity.Build.DotsRuntime.DotsRuntimeBuildProfile.ConstructPipeline () (at Library/PackageCache/com.unity.platforms@0.8.0-preview.7/Editor/Unity.Build.DotsRuntime/Components/DotsRuntimeBuildProfile.cs:29)
    3. Unity.Build.DotsRuntime.DotsRuntimeBuildProfile.set_Target (Unity.Build.DotsRuntime.BuildTarget value) (at Library/PackageCache/com.unity.platforms@0.8.0-preview.7/Editor/Unity.Build.DotsRuntime/Components/DotsRuntimeBuildProfile.cs:44)
    Maybe someone can share a build configuration/package versions that work for building a project that uses an ICustomBootstrap?

    I am using Entities 0.14.0-preview.19 and Platforms (+Desktop +Windows) 0.8.0-preview-7.
    My Build Configuration looks like this:
    upload_2020-9-12_1-35-46.png
     
  2. Wobbers

    Wobbers

    Joined:
    Dec 31, 2017
    Posts:
    55
    A month later and I still couldn't get this running. The exception when adding a DotsRuntimeBuildProfile is reproducable even in an empty project, so I wrote a bug report about it (Case 1281745), but got no response aside from the automatic one. It also doesn't show up in the Issue Tracker.

    But since I couldn't find anyone else having problems with this I guess the missing DotsRuntimeBuildProfile is not the reason why the ICustomBootstrap is not called. So what are the requirements for ICustomBootstrap getting called in builds?
     
    ENX_ likes this.
  3. DreamingImLatios

    DreamingImLatios

    Joined:
    Jun 3, 2017
    Posts:
    3,983
    With Entities 0.14, I've been using the 0.7 versions of Platforms and ICustomBootstrap has been working perfectly. I do not use the DotsRuntimeBuildProfile.
     
    Wobbers likes this.
  4. Wobbers

    Wobbers

    Joined:
    Dec 31, 2017
    Posts:
    55
    Thanks, that was helpful. I tried that configuration and it didn't work either, so it had to be something else.
    Turns out the reason was my bootstrap was placed in a package. After moving it into the assets folder it started to work.
     
    Shinyclef likes this.
  5. Shinyclef

    Shinyclef

    Joined:
    Nov 20, 2013
    Posts:
    478
    I have the same issue. The ICustomBootstrap is not getting called, but only when I use the custom build config. It executes normally when I build via the standard unity build menu. Struggling to figure this one out.
     
  6. TheOtherMonarch

    TheOtherMonarch

    Joined:
    Jul 28, 2012
    Posts:
    791
    in your defines add UNITY_DISABLE_AUTOMATIC_SYSTEM_BOOTSTRAP
     
    jasons-novaleaf likes this.