Search Unity

iOS Cloud Build - Fails - No Meaningful Errors and Confusing Stack Trace

Discussion in 'Unity Build Automation' started by NoBullIntentions_P, Dec 14, 2016.

  1. NoBullIntentions_P

    NoBullIntentions_P

    Joined:
    Jul 2, 2012
    Posts:
    311
    We've been working on getting one of our applications building in Cloud Build for best part of a week and we've simply not been able to get a single build working on iOS. There has never been a clear error message in the log whatsoever so we're just trying every permutation with nothing to go on and we've just about run out of things to try now.

    Description of issue: The build fails but there are no real errors shown. There's a stack trace with a bunch of Editor related stuff which I *think* is stopping the build but I have no idea how it relates to our project or what we would do to fix it.

    Unity version: 5.5.0f3

    XCode version: 8

    Source control: Git

    Local build platform: iOS 10 (via Mac OS Sierra)

    Build target: iOS

    Relevant plugins being used: Google Play Game Services. A custom plugin to add sqlite3 to the Xcode project. Fabric (with Crashlytics). Keen reporter.

    Project name: Iolani Palace App

    This is what I consider to be the "relevant chunk" of the build log.

    Code (csharp):
    1.  
    2. 24731: [Unity] Receiving unhandled NULL exception
    3. 24732: [Unity] Obtained 31 stack frames.
    4. 24733: [Unity] #0 0x000001026e5290 in -[GUIOpenGLView drawRect:]
    5. 24734: [Unity] #1 0x000001026ce1d0 in GUIView::RepaintAll(bool)
    6. 24735: [Unity] #2 0x00000102633285 in Application::UpdateScene(bool)
    7. 24736: [Unity] #3 0x00000102318118 in EditorSceneManager::FinishNewScene()
    8. 24737: [Unity] #4 0x0000010231802f in EditorSceneManager::NewScene(NewSceneSetup, NewSceneMode)
    9. 24738: [Unity] #5 0x00000102628618 in Application::FinishLoadingProject()
    10. 24739: [Unity] #6 0x000001026bc057 in -[EditorApplication applicationDidFinishLaunching:]
    11. 24740: [Unity] #7 0x007fff9b057bbc in __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__
    12. 24741: [Unity] #8 0x007fff9b057b4f in ___CFXRegistrationPost_block_invoke
    13. 24742: [Unity] #9 0x007fff9b057ac7 in _CFXRegistrationPost
    14. 24743: [Unity] #10 0x007fff9b057832 in ___CFXNotificationPost_block_invoke
    15. 24744: [Unity] #11 0x007fff9b0145e2 in -[_CFXNotificationRegistrar find:object:observer:enumerator:]
    16. 24745: [Unity] #12 0x007fff9b013835 in _CFXNotificationPost
    17. 24746: [Unity] #13 0x007fff947f317a in -[NSNotificationCenter postNotificationName:object:userInfo:]
    18. 24747: [Unity] #14 0x007fff8cc08355 in -[NSApplication _postDidFinishNotification]
    19. 24748: [Unity] #15 0x007fff8cc080bf in -[NSApplication _sendFinishLaunchingNotification]
    20. 24749: [Unity] #16 0x007fff8cac2d99 in -[NSApplication(NSAppleEventHandling) _handleAEOpenEvent:]
    21. 24750: [Unity] #17 0x007fff8cac2843 in -[NSApplication(NSAppleEventHandling) _handleCoreEvent:withReplyEvent:]
    22. 24751: [Unity] #18 0x007fff9484172d in -[NSAppleEventManager dispatchRawAppleEvent:withRawReply:handlerRefCon:]
    23. 24752: [Unity] #19 0x007fff948415a7 in _NSAppleEventManagerGenericHandler
    24. 24753: [Unity] #20 0x007fff94112261 in aeDispatchAppleEvent(AEDesc const*, AEDesc*, unsigned int, unsigned char*)
    25. 24754: [Unity] #21 0x007fff94111fe8 in dispatchEventAndSendReply(AEDesc const*, AEDesc*)
    26. 24755: [Unity] #22 0x007fff94111f04 in aeProcessAppleEvent
    27. 24756: [Unity] #23 0x007fff9424baf9 in AEProcessAppleEvent
    28. 24757: [Unity] #24 0x007fff8cabe290 in _DPSNextEvent
    29. 24758: [Unity] #25 0x007fff8cabd226 in -[NSApplication _nextEventMatchingEventMask:untilDate:inMode:dequeue:]
    30. 24759: [Unity] #26 0x007fff8cab1d80 in -[NSApplication run]
    31. 24760: [Unity] #27 0x007fff8ca7b368 in NSApplicationMain
    32. 24761: [Unity] #28 0x000001026d59f8 in EditorMain(int, char const**)
    33. 24762: [Unity] #29 0x000001026d6209 in main
    34. 24763: [Unity] #30 0x000001000029b4 in start
    35. 24764: /BUILD_PATH/.mason/buildpacks/unity/bin/compile: line 31: 8068 Abort trap: 6 "${unity_args[@]}"
    36. 24765: ! Unity player export failed!
    37. 24766: ! build of 'default-ios' failed. compile failed
    38.  
    Since there are no real errors, I don't know what the "relevant chunk" of the build log is for sure. So I've uploaded the entire thing here, just in case : https://www.dropbox.com/s/nevf8rl3xcn3f31/CloudBuild.txt?dl=0

    It does build locally from a fresh checkout.
     
  2. SophiaC

    SophiaC

    Joined:
    Sep 6, 2016
    Posts:
    238
    Hello,

    Looking at your project, I can see several compiler errors, for example
    To list a few

    Are you sure that this builds locally after a fresh check out?
    Do you have everything in your project checked into your source control?

    Thanks!
    - Sophia
     
  3. NoBullIntentions_P

    NoBullIntentions_P

    Joined:
    Jul 2, 2012
    Posts:
    311
    The project on CloudBuild is not in the same state it was when I built this and got this error log. One of the other developers has been trying to strip things out of the project to see if they can narrow down what the problem is.

    The logs I've reported are accurate for build #14 on Cloud Build.

    Yes, I'm quite certain that the project builds locally.
     
  4. SophiaC

    SophiaC

    Joined:
    Sep 6, 2016
    Posts:
    238
  5. NoBullIntentions_P

    NoBullIntentions_P

    Joined:
    Jul 2, 2012
    Posts:
    311
    We're not using PostProcessSceneAttributes but there is one script which uses [PostProcessBuild] which I guess is the predecessor to it.

    EDIT: Removed a false lead.

    Code (csharp):
    1.  
    2. There's this which is my own script we use to set up sqlite3, but we've had the same build problem since long before I added that.
    3.  
    4. [code]
    5. [PostProcessBuild]
    6.     public static void OnPostprocessBuild(BuildTarget buildTarget, string path)
    7.     {
    8.         if (buildTarget == BuildTarget.iOS)
    9.         {
    10.             string projPath = path + "/Unity-iPhone.xcodeproj/project.pbxproj";
    11.  
    12.             PBXProject proj = new PBXProject();
    13.             proj.ReadFromString(File.ReadAllText(projPath));
    14.  
    15.             string target = proj.TargetGuidByName("Unity-iPhone");
    16.  
    17.             proj.AddFileToBuild(target, proj.AddFile("usr/lib/libsqlite3.dylib", "Frameworks/libsqlite3.dylib", PBXSourceTree.Sdk));
    18.  
    19.             File.WriteAllText(projPath, proj.WriteToString());
    20.         }
    21.     }
    22.  
     
    Last edited: Dec 14, 2016
  6. NoBullIntentions_P

    NoBullIntentions_P

    Joined:
    Jul 2, 2012
    Posts:
    311
    Today I tried removing anything which begins with [PostProcess so that I can get all of the new ones and the old ones. There were a few from Google Analytics and Fabric as well as my own posted above. I rebuilt to see what would happen. Exactly the same result.

    So I guess we can conclude that [PostProcess stuff is not the problem.

    Excerpt from latest log - full one in Cloud Build - build #32
    Code (csharp):
    1.  
    2. 21083: [Unity] Receiving unhandled NULL exception
    3. 21084: [Unity] Obtained 31 stack frames.
    4. 21085: [Unity] #0 0x000001026e5290 in -[GUIOpenGLView drawRect:]
    5. 21086: [Unity] #1 0x000001026ce1d0 in GUIView::RepaintAll(bool)
    6. 21087: [Unity] #2 0x00000102633285 in Application::UpdateScene(bool)
    7. 21088: [Unity] #3 0x00000102318118 in EditorSceneManager::FinishNewScene()
    8. 21089: [Unity] #4 0x0000010231802f in EditorSceneManager::NewScene(NewSceneSetup, NewSceneMode)
    9. 21090: [Unity] #5 0x00000102628618 in Application::FinishLoadingProject()
    10. 21091: [Unity] #6 0x000001026bc057 in -[EditorApplication applicationDidFinishLaunching:]
    11. 21092: [Unity] #7 0x007fffa0365bbc in __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__
    12. 21093: [Unity] #8 0x007fffa0365b4f in ___CFXRegistrationPost_block_invoke
    13. 21094: [Unity] #9 0x007fffa0365ac7 in _CFXRegistrationPost
    14. 21095: [Unity] #10 0x007fffa0365832 in ___CFXNotificationPost_block_invoke
    15. 21096: [Unity] #11 0x007fffa03225e2 in -[_CFXNotificationRegistrar find:object:observer:enumerator:]
    16. 21097: [Unity] #12 0x007fffa0321835 in _CFXNotificationPost
    17. 21098: [Unity] #13 0x007fff99b0117a in -[NSNotificationCenter postNotificationName:object:userInfo:]
    18. 21099: [Unity] #14 0x007fff91f16355 in -[NSApplication _postDidFinishNotification]
    19. 21100: [Unity] #15 0x007fff91f160bf in -[NSApplication _sendFinishLaunchingNotification]
    20. 21101: [Unity] #16 0x007fff91dd0d99 in -[NSApplication(NSAppleEventHandling) _handleAEOpenEvent:]
    21. 21102: [Unity] #17 0x007fff91dd0843 in -[NSApplication(NSAppleEventHandling) _handleCoreEvent:withReplyEvent:]
    22. 21103: [Unity] #18 0x007fff99b4f72d in -[NSAppleEventManager dispatchRawAppleEvent:withRawReply:handlerRefCon:]
    23. 21104: [Unity] #19 0x007fff99b4f5a7 in _NSAppleEventManagerGenericHandler
    24. 21105: [Unity] #20 0x007fff99420261 in aeDispatchAppleEvent(AEDesc const*, AEDesc*, unsigned int, unsigned char*)
    25. 21106: [Unity] #21 0x007fff9941ffe8 in dispatchEventAndSendReply(AEDesc const*, AEDesc*)
    26. 21107: [Unity] #22 0x007fff9941ff04 in aeProcessAppleEvent
    27. 21108: [Unity] #23 0x007fff99559af9 in AEProcessAppleEvent
    28. 21109: [Unity] #24 0x007fff91dcc290 in _DPSNextEvent
    29. 21110: [Unity] #25 0x007fff91dcb226 in -[NSApplication _nextEventMatchingEventMask:untilDate:inMode:dequeue:]
    30. 21111: [Unity] #26 0x007fff91dbfd80 in -[NSApplication run]
    31. 21112: [Unity] #27 0x007fff91d89368 in NSApplicationMain
    32. 21113: [Unity] #28 0x000001026d59f8 in EditorMain(int, char const**)
    33. 21114: [Unity] #29 0x000001026d6209 in main
    34. 21115: [Unity] #30 0x000001000029b4 in start
    35. 21116: /BUILD_PATH/.mason/buildpacks/unity/bin/compile: line 31: 6466 Abort trap: 6 "${unity_args[@]}"
    36.  
     
  7. NoBullIntentions_P

    NoBullIntentions_P

    Joined:
    Jul 2, 2012
    Posts:
    311
    Any help on this?
     
  8. NoBullIntentions_P

    NoBullIntentions_P

    Joined:
    Jul 2, 2012
    Posts:
    311
  9. SophiaC

    SophiaC

    Joined:
    Sep 6, 2016
    Posts:
    238
    Going to DM you