Search Unity

Cloud build only working through clean builds since Unity 2017.4.22

Discussion in 'Unity Build Automation' started by glitchers, Mar 19, 2019.

  1. glitchers

    glitchers

    Joined:
    Apr 29, 2014
    Posts:
    64
    Description of issue:
    Since upgrading to Unity 2017.4.22 my cloud builds (PC + Mac) are always failing unless I do a clean build which takes 4-5x longer. Previously I was using Unity 2017.3.1p1.

    I am getting this error:
    3890: [Unity] -----CompilerOutput:-stdout--exitcode: 1--compilationhadfailure: True--outfile: Temp/Assembly-CSharp.dll

    But all other dlls say their compilation had no failure,

    Unity version:
    Unity 2017.4.22

    Source control:
    Git, Bitbucket

    Local build platform:
    Unity 2017.4.22

    Build target:
    PC / Mac

    Project name:
    Drive Buy

    Builds seem to also have this issue, I believe it is only Mac builds based on the logs:

    Code (CSharp):
    1. 9911: [Unity] Packing sprites:
    2. 19912: [Unity] [    143 MB ]- Skipping packing - Sprite Packer (Legacy) is off.
    3. 19913: [Unity] [    143 MB ]ERROR: Dereferencing NULL PPtr!
    4. 19914: [Unity] UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
    5. 19915: [Unity] UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
    6. 19916: [Unity] UnityEngine.Logger:Log(LogType, Object)
    7. 19917: [Unity] UnityEngine.Debug:Log(Object)
    8. 19918: [Unity] UnityEditor.CloudBuild.BuildLogger:Log(String)
    9. 19919: [Unity] UnityEditor.CloudBuild.BuildLogger:HighlightUnityErrors(String, String, LogType)
    10. 19920: [Unity] UnityEditor.BuildPipeline:BuildPlayerInternalNoCheck(String[], String, String, BuildTargetGroup, BuildTarget, BuildOptions, Boolean)
    11. 19921: [Unity] UnityEditor.CloudBuild.Builder:Build()
    12. 19922: [Unity] Dereferencing NULL PPtr!
    13. 19923: [Unity] UnityEditor.BuildPipeline:BuildPlayerInternalNoCheck(String[], String, String, BuildTargetGroup, BuildTarget, BuildOptions, Boolean)
    14. 19924: [Unity] UnityEditor.CloudBuild.Builder:Build()
    15. 19925: [Unity] Receiving unhandled NULL exception
    16. 19926: [Unity] Obtained 43 stack frames.
    17. 19927: [Unity] #0  0x000001010e542b in SpriteAtlas::ReconcilePackedSprites()
    18. 19928: [Unity] #1  0x000001010e5a28 in SpriteAtlas::PrePack(BuildTargetPlatform const&)
    19. 19929: [Unity] #2  0x000001010eed81 in PackSpriteAtlases(BuildTargetPlatform, dynamic_array<PPtr<SpriteAtlas>, 4ul>&)
    20. 19930: [Unity] #3  0x000001011e5eb4 in BuildPlayerData(BuildTargetPlatformGroup, BuildTargetPlatform, BuildPlayerOptions, BuildCompression const&, std::vector<core::basic_string<char, core::StringStorageDefault<char> >, std::allocator<core::basic_string<char, core::StringStorageDefault<char> > > >, AssetBundleBuildData*, std::vector<EditorSceneManager::SceneBackup, stl_allocator<EditorSceneManager::SceneBackup, (MemLabelIdentifier)105, 16> >&, ScriptingObjectPtr, Vector2f, BuildReporting::BuildReport&, core::basic_string<char, core::StringStorageDefault<char> > const&, BuildReporting::BuiltAssetBundleInfo*)
    21. 19931: [Unity] #4  0x000001011d7f37 in DoBuildPlayer(BuildPlayerSetup const&, std::vector<EditorSceneManager::SceneBackup, stl_allocator<EditorSceneManager::SceneBackup, (MemLabelIdentifier)105, 16> >&, core::basic_string<char, core::StringStorageDefault<char> >, std::vector<core::basic_string<char, core::StringStorageDefault<char> >, std::allocator<core::basic_string<char, core::StringStorageDefault<char> > > >, bool, BuildReporting::BuildReport&, BuildReporting::BuiltAssetBundleInfo*)
    22. 19932: [Unity] #5  0x000001011dc7db in BuildPlayer(BuildPlayerSetup const&, BuildReporting::BuildReport&)
    23. 19933: [Unity] #6  0x000001025580f4 in BuildPipeline_CUSTOM_BuildPlayerInternalNoCheck(MonoArray*, MonoString*, MonoString*, BuildTargetPlatformGroup, BuildTargetPlatform, BuildPlayerOptions, unsigned char)
    24. 19934: [Unity] #7  0x0000015170d072 in  (wrapper managed-to-native) UnityEditor.BuildPipeline:BuildPlayerInternalNoCheck (string[],string,string,UnityEditor.BuildTargetGroup,UnityEditor.BuildTarget,UnityEditor.BuildOptions,bool) + 0xd2 (0x15170cfa0 0x15170d0a1) [0x124fbe330 - Unity Child Domain]
    25. 19935: [Unity] #8  0x0000015170cf48 in  UnityEditor.BuildPipeline:BuildPlayerInternal (string[],string,string,UnityEditor.BuildTargetGroup,UnityEditor.BuildTarget,UnityEditor.BuildOptions) + 0x168 (0x15170cde0 0x15170cf89) [0x124fbe330 - Unity Child Domain]
    26. 19936: [Unity] #9  0x0000015170c6e8 in  UnityEditor.BuildPipeline:BuildPlayer (string[],string,string,UnityEditor.BuildTargetGroup,UnityEditor.BuildTarget,UnityEditor.BuildOptions) + 0x248 (0x15170c4a0 0x15170c847) [0x124fbe330 - Unity Child Domain]
    27. 19937: [Unity] #10 0x0000015170c096 in  UnityEditor.BuildPipeline:BuildPlayer (UnityEditor.BuildPlayerOptions) + 0x186 (0x15170bf10 0x15170c0d7) [0x124fbe330 - Unity Child Domain]
    28. 19938: [Unity] #11 0x0000015170bc43 in  UnityEditor.BuildPipeline:BuildPlayer (string[],string,UnityEditor.BuildTarget,UnityEditor.BuildOptions) + 0x2d3 (0x15170b970 0x15170bc84) [0x124fbe330 - Unity Child Domain]
    29. 19939: [Unity] #12 0x0000014f08a40f in  UnityEditor.CloudBuild.Builder:Build () + 0x147f (0x14f088f90 0x14f08aedc) [0x124fbe330 - Unity Child Domain]
    30. 19940: [Unity] #13 0x0000011adb6b56 in  (wrapper runtime-invoke) object:runtime_invoke_void (object,intptr,intptr,intptr) + 0xf6 (0x11adb6a60 0x11adb6c89) [0x124fbe330 - Unity Child Domain]
    31. 19941: [Unity] #14 0x00000135c3c3a2 in mono_get_runtime_build_info
    32. 19942: [Unity] #15 0x00000135d68b92 in mono_runtime_invoke
    33. 19943: [Unity] #16 0x00000101016f0a in ScriptingInvocation::Invoke(ScriptingExceptionPtr*, bool)
    34. 19944: [Unity] #17 0x000001019aed69 in Application::ParseARGVCommands()
    35. 19945: [Unity] #18 0x000001019ae2b5 in Application::FinishLoadingProject()
    36. 19946: [Unity] #19 0x000001006b6485 in -[EditorApplication applicationDidFinishLaunching:]
    37. 19947: [Unity] #20 0x007fff2ce9847c in __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__
    38. 19948: [Unity] #21 0x007fff2ce9834a in _CFXRegistrationPost
    39. 19949: [Unity] #22 0x007fff2ce98081 in ___CFXNotificationPost_block_invoke
    40. 19950: [Unity] #23 0x007fff2ce56c12 in -[_CFXNotificationRegistrar find:object:observer:enumerator:]
    41. 19951: [Unity] #24 0x007fff2ce55ca3 in _CFXNotificationPost
    42. 19952: [Unity] #25 0x007fff2ef80817 in -[NSNotificationCenter postNotificationName:object:userInfo:]
    43. 19953: [Unity] #26 0x007fff2a545206 in -[NSApplication _postDidFinishNotification]
    44. 19954: [Unity] #27 0x007fff2a544e4f in -[NSApplication _sendFinishLaunchingNotification]
    45. 19955: [Unity] #28 0x007fff2a417ab3 in -[NSApplication(NSAppleEventHandling) _handleAEOpenEvent:]
    46. 19956: [Unity] #29 0x007fff2a4176e9 in -[NSApplication(NSAppleEventHandling) _handleCoreEvent:withReplyEvent:]
    47. 19957: [Unity] #30 0x007fff2efc3664 in -[NSAppleEventManager dispatchRawAppleEvent:withRawReply:handlerRefCon:]
    48. 19958: [Unity] #31 0x007fff2efc34e2 in _NSAppleEventManagerGenericHandler
    49. 19959: [Unity] #32 0x007fff2df9bdd0 in aeDispatchAppleEvent(AEDesc const*, AEDesc*, unsigned int, unsigned char*)
    50. 19960: [Unity] #33 0x007fff2df9b677 in dispatchEventAndSendReply(AEDesc const*, AEDesc*)
    51. 19961: [Unity] #34 0x007fff2df9b565 in aeProcessAppleEvent
    52. 19962: [Unity] #35 0x007fff2c1724a0 in AEProcessAppleEvent
    53. 19963: [Unity] #36 0x007fff2a412d32 in _DPSNextEvent
    54. 19964: [Unity] #37 0x007fff2aba8e34 in -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:]
    55. 19965: [Unity] #38 0x007fff2a407885 in -[NSApplication run]
    56. 19966: [Unity] #39 0x007fff2a3d6a72 in NSApplicationMain
    57. 19967: [Unity] #40 0x000001006d5387 in EditorMain(int, char const**)
    58. 19968: [Unity] #41 0x000001006d5809 in main
    59. 19969: [Unity] #42 0x007fff54e53015 in start
    60. 19970:        ! Unity player export failed!
    61. 19971: ! build of '********' failed. exit
    62. 19972: Publishing build 157 of ******** for target '********'...
    63. 19973: publishing finished successfully.
    64. 19974: Zipping cache files from Library
    65. 19975: done.
    66. 19976: Build step 'Execute shell' marked build as failure
    67. 19977: postbuildstatus finished successfully.
    68. 19978: postbuildsteps finished successfully
    69. 19979: Finished: FAILURE
     
  2. TommyTheITGuy

    TommyTheITGuy

    Joined:
    Jun 11, 2015
    Posts:
    53
    We also experience this bug in 2017.4.23. It also happens on Windows machines and with local builds. It has to do with sprite atlases repacking using non-existant sprites.
    1. Sprite atlas is packed for first time - it's modified and the list of packed sprites is stored inside of it.
    2. Some sprites from this atlas are removed.
    3. Repacking the atlas causes the above crash, because Unity tries to dereference a non-existing asset.

    I reported this bug with a reproduction project and am currently awaiting a reply (ticket 1141327_8178sqfhvoj42058).

    A temporary workaround is to run a script before each build, that removes all packed sprites from Sprite Atlas assets.

    Edit:
    Reply from Unity on 02/04/2019:
     
    Last edited: Apr 10, 2019
    glitchers and victorw like this.
  3. TommyTheITGuy

    TommyTheITGuy

    Joined:
    Jun 11, 2015
    Posts:
    53
    Apparently they fixed this in 2017.4.28

    2D: Fixed crash on "SpriteAtlas::ReconcilePackedSprites" during AssetBundle build while repacking Sprite Atlases. (1142859)