nesterenkodm / pjsip

PJSIP is Open Source SIP, Media, and NAT Traversal Library
495 stars 220 forks source link

Example Crashed After Running #90

Closed lyce90 closed 4 years ago

lyce90 commented 4 years ago

Hi,

  1. I downloaded the git repository,
  2. edit the Podfile at Example Folder to the following:
platform :ios, '7.0'
target 'ipjsystest' do
  use_frameworks!
    pod 'pjsip'
end
  1. Run pod Install
  2. Changed the Bundle versions string, short to 0.9.0
  3. Build and Run

The built was successful but after the simulator ran, it immediately crashed with the following message. Did I do anything wrong?

2019-11-23 03:31:48.579936+0800 ipjsystest[3541:90670] *** Assertion failure in -[UIApplication _runWithMainScene:transitionContext:completion:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKitCore_Sim/UIKit-3900.12.16/UIApplication.m:4239
2019-11-23 03:31:48.590154+0800 ipjsystest[3541:90670] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Application windows are expected to have a root view controller at the end of application launch'
*** First throw call stack:
(
    0   CoreFoundation                      0x00007fff23c4f02e __exceptionPreprocess + 350
    1   libobjc.A.dylib                     0x00007fff50b97b20 objc_exception_throw + 48
    2   CoreFoundation                      0x00007fff23c4eda8 +[NSException raise:format:arguments:] + 88
    3   Foundation                          0x00007fff256c9b61 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 191
    4   UIKitCore                           0x00007fff4784e0e8 -[UIApplication _runWithMainScene:transitionContext:completion:] + 2307
    5   UIKitCore                           0x00007fff46f843c9 -[_UISceneLifecycleMultiplexer completeApplicationLaunchWithFBSScene:transitionContext:] + 122
    6   UIKitCore                           0x00007fff47471be1 _UIScenePerformActionsWithLifecycleActionMask + 83
    7   UIKitCore                           0x00007fff46f84edb __101-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]_block_invoke + 198
    8   UIKitCore                           0x00007fff46f848ea -[_UISceneLifecycleMultiplexer _performBlock:withApplicationOfDeactivationReasons:fromReasons:] + 296
    9   UIKitCore                           0x00007fff46f84d08 -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:] + 818
    10  UIKitCore                           0x00007fff46f8459d -[_UISceneLifecycleMultiplexer uiScene:transitionedFromState:withTransitionContext:] + 345
    11  UIKitCore                           0x00007fff46f88bcb __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke_2 + 178
    12  UIKitCore                           0x00007fff4739769b +[BSAnimationSettings(UIKit) tryAnimatingWithSettings:actions:completion:] + 865
    13  UIKitCore                           0x00007fff4749051f _UISceneSettingsDiffActionPerformChangesWithTransitionContext + 240
    14  UIKitCore                           0x00007fff46f888e6 __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke + 153
    15  UIKitCore                           0x00007fff47490422 _UISceneSettingsDiffActionPerformActionsWithDelayForTransitionContext + 84
    16  UIKitCore                           0x00007fff46f88754 -[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:] + 381
    17  UIKitCore                           0x00007fff46ddf123 __64-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke + 657
    18  UIKitCore                           0x00007fff46dddca8 -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 248
    19  UIKitCore                           0x00007fff46ddee4d -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 210
    20  UIKitCore                           0x00007fff4784c343 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 535
    21  UIKitCore                           0x00007fff473b920d -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 361
    22  FrontBoardServices                  0x00007fff36555225 -[FBSSceneImpl _callOutQueue_agent_didCreateWithTransitionContext:completion:] + 442
    23  FrontBoardServices                  0x00007fff3657b598 __86-[FBSWorkspaceScenesClient sceneID:createWithParameters:transitionContext:completion:]_block_invoke.154 + 102
    24  FrontBoardServices                  0x00007fff3655fd05 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 220
    25  FrontBoardServices                  0x00007fff3657b229 __86-[FBSWorkspaceScenesClient sceneID:createWithParameters:transitionContext:completion:]_block_invoke + 355
    26  libdispatch.dylib                   0x000000010d619d48 _dispatch_client_callout + 8
    27  libdispatch.dylib                   0x000000010d61ccb9 _dispatch_block_invoke_direct + 300
    28  FrontBoardServices                  0x00007fff365a143e __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 30
    29  FrontBoardServices                  0x00007fff365a112c -[FBSSerialQueue _queue_performNextIfPossible] + 441
    30  FrontBoardServices                  0x00007fff365a163b -[FBSSerialQueue _performNextFromRunLoopSource] + 22
    31  CoreFoundation                      0x00007fff23bb2221 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
    32  CoreFoundation                      0x00007fff23bb214c __CFRunLoopDoSource0 + 76
    33  CoreFoundation                      0x00007fff23bb1924 __CFRunLoopDoSources0 + 180
    34  CoreFoundation                      0x00007fff23bac62f __CFRunLoopRun + 1263
    35  CoreFoundation                      0x00007fff23babe16 CFRunLoopRunSpecific + 438
    36  GraphicsServices                    0x00007fff38438bb0 GSEventRunModal + 65
    37  UIKitCore                           0x00007fff4784fb48 UIApplicationMain + 1621
    38  ipjsystest                          0x000000010d0ba188 main + 72
    39  libdyld.dylib                       0x00007fff51a1dc25 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 
welljsjs commented 4 years ago

@lyce90 Can you take your time and use the issue template or at least format your code properly, please?

lyce90 commented 4 years ago

@welljsjs My apologies, I have reformatted the code.

welljsjs commented 4 years ago

Thanks. Also, the examples are a little out of date I think.

I'd recommend having a look at this basic example: https://www.pjsip.org/pjsip/docs/html/page_pjsip_sample_simple_pjsuaua_c.htm

That should fulfill your needs at first. It's also the shortest example.

I am not sure whether the examples are actually still supposed to work. I wouldn't rely on them though.

github-actions[bot] commented 4 years ago

This issue is stale because it had been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.