Search Unity

Build fails with error: Player export failed. Reason: 3 errors

Discussion in 'Unity Build Automation' started by esg-joshmorhart, Jun 2, 2017.

  1. esg-joshmorhart

    esg-joshmorhart

    Joined:
    Oct 10, 2016
    Posts:
    9
    Description of issue: The build is failing with a non-descriptive error. There is also the error " Assertion failed on expression: 'ms_Instance != NULL'"

    Unity version: 5.6.0f3

    Source control: git

    Local build platform: Windows

    Build target: Android

    Build log (relevant chunk):

    Code (csharp):
    1.  
    2. 98666: [Unity] *** Completed 'Build.Player.AndroidPlayer' in 174 seconds (174193 ms)
    3. 98667: [Unity] Player export failed. Reason: 3 errors
    4. 98668: [Unity] UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
    5. 98669: [Unity] UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    6. 98670: [Unity] UnityEngine.Logger:Log(LogType, Object)
    7. 98671: [Unity] UnityEngine.Debug:Log(Object)
    8. 98672: [Unity] UnityEditor.CloudBuild.BuildLogger:Log(String, Object[])
    9. 98673: [Unity] UnityEditor.CloudBuild.Builder:Build()
    10. 98674: [Unity] Refresh: detecting if any assets need to be imported or removed ... Refresh: elapses 0.162417 seconds (Nothing changed)
    11. 98675: [Unity] Refresh: detecting if any assets need to be imported or removed ... Refresh: elapses 0.143060 seconds (Nothing changed)
    12. 98676: [Unity] Cleanup mono
    13. 98677: [Unity] Checking for leaked weakptr:
    14. 98678: [Unity]   Found no leaked weakptrs.
    15. 98679: [Unity] Assertion failed on expression: 'ms_Instance != NULL'
    16. 98680: [Unity] ##unity-automation:{"messageType":"MemoryLeaks","allocatedMemory":16627346,"memoryLabels":[{"Default":96},{"Permanent":16128},{"NewDelete":4194320},{"Thread":616},{"Manager":1976},{"GfxDevice":21664},{"GfxThread":2688},{"Physics":8},{"Serialization":12704},{"JobScheduler":144},{"GarbageCollector":1048576},{"Renderer":224},{"Terrain":224},{"STL":131584},{"String":122025},{"DynamicArray":3112},{"Utility":-1048576},{"PoolAlloc":-224},{"ScriptManager":3280},{"Sprites":12096336},{"VR":11404},{"EditorUtility":544},{"AssetImporter":712},{"RestService":64},{"License":965},{"UnityConnect":6024},{"Collab":728}]}
    17. 98681:  ! Unity player export failed!
    18. 98682: ! build of 'android-dev-josh' failed. compile failed
    19. 98683: Publishing build 45 of east-side-games/trailer-park-boys-greasy-money for target 'android-dev-josh'...
    20. 98684: publishing finished successfully.
    21. 98685: Storing CACHE_PATH to cache key library_5_6_0f3
    22. 98686: done.
    23. 98687: Build step 'Execute shell' marked build as failure
    24. 98688: postbuildstatus finished successfully.
    25. 98689: Finished: FAILURE

    Does it build locally from a fresh checkout? Yes
     
  2. Marc-Uberstein

    Marc-Uberstein

    Joined:
    Apr 10, 2013
    Posts:
    9
  3. Talarian

    Talarian

    Joined:
    Aug 8, 2014
    Posts:
    10
    We're hitting this as well, on Unity 5.6.2p3:

    Code (CSharp):
    1. Assertion failed on expression: 'ms_Instance != NULL'
    2. (Filename: C:\buildslave\unity\build\Runtime/Network/PlayerCommunicator/ManagedProxy/GeneralConnectionManaged.cpp Line: 118)
    3.  
    4. ##unity-automation:{"messageType":"MemoryLeaks","allocatedMemory":1375755,"memoryLabels":[{"Default":64},{"Permanent":20240},{"NewDelete":257748},{"Thread":608},{"Manager":3016},{"VertexData":288},{"GfxDevice":27404},{"GfxThread":2688},{"Physics":8},{"Serialization":12704},{"JobScheduler":136},{"GarbageCollector":1048576},{"BaseObject":512},{"Renderer":224},{"Skinning":104},{"Terrain":224},{"STL":131584},{"String":185450},{"DynamicArray":3324},{"Utility":-1048576},{"PoolAlloc":-224},{"ScriptManager":3280},{"Sprites":705416},{"VR":12908},{"EditorGui":12},{"EditorUtility":544},{"AssetImporter":32},{"RestService":72},{"License":653},{"UnityConnect":6032},{"Collab":704}]}
    Any ideas?
     
  4. developersice

    developersice

    Joined:
    Nov 25, 2016
    Posts:
    36
    Any update on this issue?
     
  5. Talarian

    Talarian

    Joined:
    Aug 8, 2014
    Posts:
    10
    For our project, we narrowed the issue down to a Volumetric Lighting addon we grabbed from here: https://github.com/Unity-Technologies/VolumetricLighting

    When using Unity's batch mode to headlessly build, it causes the error I pasted above. I didn't get to the point where I narrowed down the precise code that was causing the issue, but it seems TubeLight.cs and AreaLight.cs when compiled in would cause issues. I've attached a min project to hit the issue for the Unity devs (and am linking my bug report on the Volumetric Lighting project here: https://github.com/Unity-Technologies/VolumetricLighting/issues/14)

    Repro steps:
    1. Make a new project in Unity 5.6+ (tested in 5.6.1p4 and 5.6.2p3)
    2. Drop the attached assets folder in
    3. Close Unity
    4. Run the batch script "sparkbuild_test.bat" contained in the folder on Windows
    Expected: a successful build
    Actual: Build sort of succeeds (files are correctly output), but Unity returns an error in post-processing. Logs are as my post above. Note the build succeeds when done from within the Editor.

    It looks like a Unity bug to me, but am unsure. Figured it'd be best to post both here and in the project I found the bug in.
     

    Attached Files:

  6. developersice

    developersice

    Joined:
    Nov 25, 2016
    Posts:
    36
    Hopefully the Unity staff can see it and take a look into it for you also, we are having an issue with our code accessing a dll file that apparently isn't meant to be accessible from a C# unity build.. but it still builds on our local systems - but not on cloud build.
     
  7. avive_jellybtn

    avive_jellybtn

    Joined:
    Jul 24, 2016
    Posts:
    4
    Hi esg-joshmorhart,
    Did you manage to fix the issue? getting the same with batchmode building in Unity 5.6.2p4