Search Unity

Inconsistent when building via the command line

Discussion in 'Editor & General Support' started by hectorSBM, Oct 1, 2018.

  1. hectorSBM

    hectorSBM

    Joined:
    Feb 4, 2017
    Posts:
    15
    Since I upgraded the project to 2018.2.9f1, the game immediately crashes only for iOS builds. However, if I use the Unity Editor to Build and Run, the project works as intended. When I look at the stack trace in Xcode, it doesn't reach any managed code, and crashes during the initialization of Metal.

    These are the command line arguments:
    Code (CSharp):
    1. 18:43:26 /Applications/Unity/Hub/Editor/2018.2.9f1/Unity.app/Contents/MacOS/Unity
    2. 18:43:26 -quit
    3. 18:43:26 -batchmode
    4. 18:43:26 -projectPath
    5. 18:43:26 (projectPath)
    6. 18:43:26 -executeMethod
    7. 18:43:26 Build.BuildiOS
    8. 18:43:26 -serial
    9. 18:43:26 (hidden)
    10. 18:43:26 -username
    11. 18:43:26 (hidden)
    12. 18:43:26 -password
    13. 18:43:26 (hidden)
    14. 18:43:26 -logFile
    15. 18:43:26 (path)/UnityLog.txt
    16. 18:43:26 -buildTarget
    17. 18:43:26 iOS
    This is what I am using to build:
    Code (CSharp):
    1. var target = BuildTarget.iOS;
    2. options = BuildOptions.Development | BuildOptions.AllowDebugging | BuildOptions.ConnectWithProfiler;
    3.  
    4. BuildPipeline.BuildPlayer(BuildScenes, locationPath, target, options);
     
  2. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    Just to make sure i understand what you say:
    1. When building from Unity (Build & run) it will automatically deploy the game to the iOS device and work fine ?
    2. When building from the command line, it'll start and immediately crash ?

    Can you post the stack trace of the crash please?
     
  3. hardcodednumber

    hardcodednumber

    Joined:
    May 26, 2014
    Posts:
    88
    1. Correct, If I use the editor to build, or build and run it works as intended.
    2.
    Code (CSharp):
    1. 2018-10-03 18:50:55.003797-0700 develop[19914:2666993] [DYMTLInitPlatform] platform initialization successful
    2. 2018-10-03 18:50:55.032811-0700 develop[19914:2666731] UnityIAP UnityEarlyTransactionObserver: Created
    3. 2018-10-03 18:50:55.033422-0700 develop[19914:2666731] UnityIAP UnityEarlyTransactionObserver: Registered for lifecycle events
    4. CrashReporter: initialized
    5. 2018-10-03 18:50:55.163384-0700 develop[19914:2666731] Built from '2018.2/release' branch, Version '2018.2.9f1 (2207421190e9)', Build type 'Development', Scripting Backend 'il2cpp'
    6. 2018-10-03 18:50:55.173340-0700 develop[19914:2666731] -> registered mono modules 0x104437fe0
    7. 2018-10-03 18:50:55.184001-0700 develop[19914:2666731] initializing AppsFlyerAppController
    8. 2018-10-03 18:50:55.230748-0700 develop[19914:2666731] Called init with app ID: (null)
    9. 2018-10-03 18:50:55.240662-0700 develop[19914:2666731] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
    10. 2018-10-03 18:50:55.241300-0700 develop[19914:2666731] [MC] Reading from public effective user settings.
    11. -> applicationDidFinishLaunching()
    12. PlayerConnection initialized from /var/containers/Bundle/Application/42F50A99-0321-4768-A8EF-3801DB4236C5/develop.app/Data (debug = 0)
    13. PlayerConnection initialized network socket : 0.0.0.0 55000
    14. Multi-casting "[IP] 100.119.105.246 [Port] 55000 [Flags] 3 [Guid] 980915052 [EditorId] 3382734819 [Version] 1048832 [Id] iPhonePlayer(hectors-iPhone):56000 [Debug] 1 [PackageName] iPhonePlayer" to [225.0.0.222:54997]...
    15. Waiting for connection from host on [0.0.0.0:55000]...
    16. Timed out. Continuing without host connection.
    17. Started listening to [0.0.0.0:55000]
    18. develop was compiled with optimization - stepping may behave oddly; variables may not be available.
    19. (lldb) bt all
    20. * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x40)
    21.   * frame #0: 0x000000010264be2c develop`il2cpp::utils::Debugger::InitializeTypeSourceFileMap() at Debugger.cpp:123 [opt]
    22.     frame #1: 0x000000010264c194 develop`il2cpp::utils::Debugger::Start() at Debugger.cpp:149 [opt]
    23.     frame #2: 0x0000000102644ae4 develop`il2cpp::vm::Runtime::Init(filename=<unavailable>, runtime_version=<unavailable>) at Runtime.cpp:339 [opt]
    24.     frame #3: 0x0000000101d4ae88 develop`::InitializeIl2CppFromMain() at MonoManager_Il2Cpp.cpp:257 [opt]
    25.     frame #4: 0x00000001017196c8 develop`::UnityInitApplicationNoGraphics() at LibEntryPoint.mm:177 [opt]
    26.     frame #5: 0x0000000100e0a068 develop`::-[UnityAppController application:didFinishLaunchingWithOptions:](self=0x0000000283f583f0, _cmd="oneSignalApplication:didFinishLaunchingWithOptions:", application=0x000000010c101f50, launchOptions=0x0000000000000000) at UnityAppController.mm:263
    27.     frame #6: 0x000000010157c980 develop`-[UIApplication(self=0x0000000283f583f0, _cmd="application:didFinishLaunchingWithOptions:", application=0x000000010c101f50, launchOptions=0x0000000000000000) oneSignalApplication:didFinishLaunchingWithOptions:] at OneSignalUnityRuntime.m:136
    28.     frame #7: 0x0000000230f1e5f8 UIKitCore`-[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 412
    29.     frame #8: 0x0000000230f1fd60 UIKitCore`-[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 3340
    30.     frame #9: 0x0000000230f257ac UIKitCore`-[UIApplication _runWithMainScene:transitionContext:completion:] + 1552
    31.     frame #10: 0x000000023174cdb8 UIKitCore`__111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 784
    32.     frame #11: 0x0000000231749364 UIKitCore`+[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 160
    33.     frame #12: 0x000000023174ca34 UIKitCore`-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 240
    34.     frame #13: 0x000000023174d3d4 UIKitCore`-[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 1076
    35.     frame #14: 0x000000023170c5fc UIKitCore`__82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 772
    36.     frame #15: 0x000000023170c2a8 UIKitCore`-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 432
    37.     frame #16: 0x000000023174f844 UIKitCore`__125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 220
    38.     frame #17: 0x0000000231750334 UIKitCore`_performActionsWithDelayForTransitionContext + 112
    39.     frame #18: 0x000000023174f6fc UIKitCore`-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 248
    40.     frame #19: 0x0000000231748a10 UIKitCore`-[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 368
    41.     frame #20: 0x0000000230f23ca4 UIKitCore`-[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 540
    42.     frame #21: 0x0000000230f5545c UIKitCore`-[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 364
    43.     frame #22: 0x00000002070a3890 FrontBoardServices`-[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 444
    44.     frame #23: 0x00000002070ae658 FrontBoardServices`__56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 260
    45.     frame #24: 0x00000002070add50 FrontBoardServices`__40-[FBSWorkspace _performDelegateCallOut:]_block_invoke + 64
    46.     frame #25: 0x00000002040ac484 libdispatch.dylib`_dispatch_client_callout + 16
    47.     frame #26: 0x00000002040833f0 libdispatch.dylib`_dispatch_block_invoke_direct$VARIANT$armv81 + 216
    48.     frame #27: 0x00000002070e2640 FrontBoardServices`__FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 40
    49.     frame #28: 0x00000002070e22cc FrontBoardServices`-[FBSSerialQueue _performNext] + 416
    50.     frame #29: 0x00000002070e28e8 FrontBoardServices`-[FBSSerialQueue _performNextFromRunLoopSource] + 56
    51.     frame #30: 0x00000002046025b8 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
    52.     frame #31: 0x0000000204602538 CoreFoundation`__CFRunLoopDoSource0 + 88
    53.     frame #32: 0x0000000204601e1c CoreFoundation`__CFRunLoopDoSources0 + 176
    54.     frame #33: 0x00000002045fcce8 CoreFoundation`__CFRunLoopRun + 1040
    55.     frame #34: 0x00000002045fc5b8 CoreFoundation`CFRunLoopRunSpecific + 436
    56.     frame #35: 0x0000000206870584 GraphicsServices`GSEventRunModal + 100
    57.     frame #36: 0x0000000230f27558 UIKitCore`UIApplicationMain + 212
    58.     frame #37: 0x0000000100de2824 develop`main(argc=1, argv=0x000000016f023840) at main.mm:33
    59.     frame #38: 0x00000002040bcb94 libdyld.dylib`start + 4
    60.   thread #4, name = 'gputools.smt_poll.0x280d58da0'
    61.     frame #0: 0x0000000204209428 libsystem_kernel.dylib`__semwait_signal + 8
    62.     frame #1: 0x000000020417e5d0 libsystem_c.dylib`nanosleep + 212
    63.     frame #2: 0x000000020417e4a4 libsystem_c.dylib`usleep + 64
    64.     frame #3: 0x000000010ac6edf4 GPUToolsCore`smt_poll_thread_entry(void*) + 136
    65.     frame #4: 0x000000020428d2fc libsystem_pthread.dylib`_pthread_body + 128
    66.     frame #5: 0x000000020428d25c libsystem_pthread.dylib`_pthread_start + 48
    67.     frame #6: 0x0000000204290d08 libsystem_pthread.dylib`thread_start + 4
    68.   thread #6, name = 'gputools.smt_poll.0x280d44320'
    69.     frame #0: 0x0000000204209428 libsystem_kernel.dylib`__semwait_signal + 8
    70.     frame #1: 0x000000020417e5d0 libsystem_c.dylib`nanosleep + 212
    71.     frame #2: 0x000000020417e4a4 libsystem_c.dylib`usleep + 64
    72.     frame #3: 0x000000010ac6edf4 GPUToolsCore`smt_poll_thread_entry(void*) + 136
    73.     frame #4: 0x000000020428d2fc libsystem_pthread.dylib`_pthread_body + 128
    74.     frame #5: 0x000000020428d25c libsystem_pthread.dylib`_pthread_start + 48
    75.     frame #6: 0x0000000204290d08 libsystem_pthread.dylib`thread_start + 4
    76.   thread #7
    77.     frame #0: 0x000000020428b070 libsystem_pthread.dylib`_pthread_mutex_firstfit_lock_slow$VARIANT$armv81 + 148
    78.     frame #1: 0x0000000101ce0654 develop`::UpdateStreams() [inlined] AutoLock at Mutex.h:29 [opt]
    79.     frame #2: 0x0000000101ce064c develop`::UpdateStreams() [inlined] AutoLock at Mutex.h:29 [opt]
    80.     frame #3: 0x0000000101ce064c develop`::UpdateStreams() at Dispatcher.cpp:211 [opt]
    81.     frame #4: 0x0000000101ce0a3c develop`::Run() at Dispatcher.cpp:182 [opt]
    82.     frame #5: 0x0000000101ce0530 develop`::ThreadFunc() at Dispatcher.cpp:169 [opt]
    83.     frame #6: 0x0000000101bca4fc develop`::RunThreadWrapper() at Thread.cpp:42 [opt]
    84.     frame #7: 0x000000020428d2fc libsystem_pthread.dylib`_pthread_body + 128
    85.     frame #8: 0x000000020428d25c libsystem_pthread.dylib`_pthread_start + 48
    86.     frame #9: 0x0000000204290d08 libsystem_pthread.dylib`thread_start + 4
    87.   thread #8, name = 'com.apple.uikit.eventfetch-thread'
    88.     frame #0: 0x00000002041fded0 libsystem_kernel.dylib`mach_msg_trap + 8
    89.     frame #1: 0x00000002041fd3a8 libsystem_kernel.dylib`mach_msg + 72
    90.     frame #2: 0x0000000204601fb0 CoreFoundation`__CFRunLoopServiceMachPort + 236
    91.     frame #3: 0x00000002045fce4c CoreFoundation`__CFRunLoopRun + 1396
    92.     frame #4: 0x00000002045fc5b8 CoreFoundation`CFRunLoopRunSpecific + 436
    93.     frame #5: 0x0000000204ff06a4 Foundation`-[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 300
    94.     frame #6: 0x0000000204ff0550 Foundation`-[NSRunLoop(NSRunLoop) runUntilDate:] + 148
    95.     frame #7: 0x0000000230e84ac0 UIKitCore`-[UIEventFetcher threadMain] + 136
    96.     frame #8: 0x00000002051233b0 Foundation`__NSThread__start__ + 1040
    97.     frame #9: 0x000000020428d2fc libsystem_pthread.dylib`_pthread_body + 128
    98.     frame #10: 0x000000020428d25c libsystem_pthread.dylib`_pthread_start + 48
    99.     frame #11: 0x0000000204290d08 libsystem_pthread.dylib`thread_start + 4
    100.   thread #9
    101.     frame #0: 0x0000000204290cfc libsystem_pthread.dylib`start_wqthread
    102.   thread #10
    103.     frame #0: 0x0000000204209b9c libsystem_kernel.dylib`__workq_kernreturn + 8
    104.     frame #1: 0x000000020428e114 libsystem_pthread.dylib`_pthread_wqthread + 348
    105.     frame #2: 0x0000000204290d00 libsystem_pthread.dylib`start_wqthread + 4
    106.   thread #11
    107.     frame #0: 0x0000000000000000
    108.   thread #12, name = 'GC Finalizer'
    109.     frame #0: 0x0000000204208f0c libsystem_kernel.dylib`__psynch_cvwait + 8
    110.     frame #1: 0x000000020428a4c8 libsystem_pthread.dylib`_pthread_cond_wait$VARIANT$armv81 + 620
    111.     frame #2: 0x0000000102614a44 develop`il2cpp::os::posix::PosixWaitObject::Wait(this=<unavailable>, timeoutMS=<unavailable>, interruptible=<unavailable>) at PosixWaitObject.cpp:125 [opt]
    112.     frame #3: 0x00000001025ec7e4 develop`il2cpp::gc::FinalizerThread(arg=<unavailable>) at GarbageCollector.cpp:93 [opt]
    113.     frame #4: 0x000000010260fcec develop`il2cpp::os::Thread::RunWrapper(arg=<unavailable>) at Thread.cpp:168 [opt]
    114.     frame #5: 0x0000000102618f1c develop`il2cpp::os::ThreadImpl::ThreadStartWrapper(arg=0x000000010c14afb0) at ThreadImpl.cpp:104 [opt]
    115.     frame #6: 0x000000020428d2fc libsystem_pthread.dylib`_pthread_body + 128
    116.     frame #7: 0x000000020428d25c libsystem_pthread.dylib`_pthread_start + 48
    117.     frame #8: 0x0000000204290d08 libsystem_pthread.dylib`thread_start + 4
    I did notice that the Code Signing Entitlements is wrong. It seems that in this version of Unity it is automatically creating the entitlements file, not the file generated though the PostBuild attribute.
     
  4. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    Can you try experimenting with other options, for example - building without setting the build options you're currently giving? (debugging, etc)
     
  5. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    Also, from the command line are you getting an IPA or an Xcode project?
     
  6. hectorSBM

    hectorSBM

    Joined:
    Feb 4, 2017
    Posts:
    15
    Correct, both are created. Let me state that nothing in our build pipeline has changed. Just the fact that I have upgraded from 2018.1.3f1 -> 2018.2.9f1
     
  7. hectorSBM

    hectorSBM

    Joined:
    Feb 4, 2017
    Posts:
    15