Describe your dev environment here, giving as many details as possible. If you have them, make sure to include:
12.3[Cocoapods] version 1.10.1I expected my application to run as usual.
Facebook SDK crashed on first launch after sdk version updated to 9.0.0.
It runs as usual on other launches.
Update Facebook SDK from a lower version to version 9.0.0. Then run the app, it crashes.
It will run as usual on second launch.
I didn't do any advanced integration, just called activateApp method.
AppEvents.activateApp()
Hi @alperkayabasi , thanks for the report. Can you share the crash log/stacktrace?
Hi, i have the same problem
stacktrace
```
_dispatch_once_wait.cold.1 + 14
frame #1: 0x0000000103d2d2bc libdispatch.dylib_dispatch_once_wait + 97+[FBSDKAppEvents singleton] [inlined] _dispatch_once(predicate=0x0000000101ea0410, block=0x0000000101d6ce10) at once.h:84:3
frame #3: 0x0000000101d6cdcd FBSDKCoreKit+FBSDKAppEvents singleton at FBSDKAppEvents.m:925+[FBSDKAppEvents logInternalEvent:valueToSum:parameters:isImplicitlyLogged:accessToken:](self=FBSDKAppEvents, _cmd="logInternalEvent:valueToSum:parameters:isImplicitlyLogged:accessToken:", eventName=@"fb_sdk_settings_changed", valueToSum=0x0000000000000000, parameters=4 key/value pairs, isImplicitlyLogged=YES, accessToken=0x0000000000000000) at FBSDKAppEvents.m:901:6
frame #5: 0x0000000101d6c83f FBSDKCoreKit+FBSDKAppEvents logInternalEvent:parameters:isImplicitlyLogged: at FBSDKAppEvents.m:863:3+[FBSDKSettings _logIfSDKSettingsChanged](self=FBSDKSettings, _cmd="_logIfSDKSettingsChanged") at FBSDKSettings.m:447:5
frame #7: 0x0000000101e17d0e FBSDKCoreKit+FBSDKSettings initialize at FBSDKSettings.m:106:5CALLING_SOME_+initialize_METHOD + 17
frame #9: 0x00007fff20179326 libobjc.A.dylibinitializeNonMetaClass + 717initializeAndMaybeRelock(objc_class*, objc_object*, mutex_tt<false>&, bool) + 173
frame #11: 0x00007fff20185b8f libobjc.A.dyliblookUpImpOrForward + 668_objc_msgSend_uncached + 75
frame #13: 0x0000000101e148a6 FBSDKCoreKit+FBSDKServerConfigurationManager loadServerConfigurationWithCompletionBlock: at FBSDKServerConfigurationManager.m:118:23-[FBSDKAppEvents fetchServerConfiguration:](self=0x0000600001ea63f0, _cmd="fetchServerConfiguration:", callback=(null)) at FBSDKAppEvents.m:1078:3
frame #15: 0x0000000101d69821 FBSDKCoreKit-FBSDKAppEvents init at FBSDKAppEvents.m:375:5__27+[FBSDKAppEvents singleton]_block_invoke(.block_descriptor=0x00007ffeef7fd368) at FBSDKAppEvents.m:926:14
frame #17: 0x0000000103d2c9c8 libdispatch.dylib_dispatch_client_callout + 8_dispatch_once_callout + 66
frame #19: 0x0000000101d6cde8 FBSDKCoreKit+[FBSDKAppEvents singleton] [inlined] _dispatch_once(predicate=0x0000000101ea0410, block=0x0000000101d6ce10) at once.h:84:3+[FBSDKAppEvents singleton](self=FBSDKAppEvents, _cmd="singleton") at FBSDKAppEvents.m:925
frame #21: 0x0000000101d6b201 FBSDKCoreKit+FBSDKAppEvents activateApp at FBSDKAppEvents.m:639:30AppDelegate.application(application=0x00007fb3f0c044a0, launchOptions=nil, self=0x0000600003db92e0) at AppDelegate.swift:32:19
frame #23: 0x00000001008db173 XXX@objc AppDelegate.application(_:didFinishLaunchingWithOptions:) at -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 232
frame #25: 0x00007fff24672fef UIKitCore-[UIApplication _callInitializationDelegatesWithActions:forCanvas:payload:fromOriginatingProcess:] + 3919-[UIApplication _runWithMainScene:transitionContext:completion:] + 1237
frame #27: 0x00007fff23ca37bb UIKitCore-[_UISceneLifecycleMultiplexer completeApplicationLaunchWithFBSScene:transitionContext:] + 122_UIScenePerformActionsWithLifecycleActionMask + 88
frame #29: 0x00007fff23ca42ca UIKitCore__101-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]_block_invoke + 198-[_UISceneLifecycleMultiplexer _performBlock:withApplicationOfDeactivationReasons:fromReasons:] + 474
frame #31: 0x00007fff23ca40fb UIKitCore-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:] + 819-[_UISceneLifecycleMultiplexer uiScene:transitionedFromState:withTransitionContext:] + 345
frame #33: 0x00007fff23cabc27 UIKitCore__186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke + 178+[BSAnimationSettings(UIKit) tryAnimatingWithSettings:actions:completion:] + 871
frame #35: 0x00007fff2424dab2 UIKitCore_UISceneSettingsDiffActionPerformChangesWithTransitionContext + 240-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:] + 361
frame #37: 0x00007fff23acf034 UIKitCore__64-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke + 797-[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 253
frame #39: 0x00007fff23acec6d UIKitCore-[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 208-[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 508
frame #41: 0x00007fff241633f3 UIKitCore-[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 358-[FBSScene _callOutQueue_agent_didCreateWithTransitionContext:completion:] + 391
frame #43: 0x00007fff25aa6b41 FrontBoardServices__94-[FBSWorkspaceScenesClient createWithSceneID:groupID:parameters:transitionContext:completion:]_block_invoke.176 + 102-[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 209
frame #45: 0x00007fff25aa680f FrontBoardServices__94-[FBSWorkspaceScenesClient createWithSceneID:groupID:parameters:transitionContext:completion:]_block_invoke + 352_dispatch_client_callout + 8
frame #47: 0x0000000103d2f910 libdispatch.dylib_dispatch_block_invoke_direct + 295__FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 30
frame #49: 0x00007fff25acc48b FrontBoardServices-[FBSSerialQueue _targetQueue_performNextIfPossible] + 433-[FBSSerialQueue _performNextFromRunLoopSource] + 22
frame #51: 0x00007fff2038c37a CoreFoundation__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17__CFRunLoopDoSource0 + 180
frame #53: 0x00007fff2038b754 CoreFoundation__CFRunLoopDoSources0 + 248__CFRunLoopRun + 878
frame #55: 0x00007fff203856c6 CoreFoundationCFRunLoopRunSpecific + 567GSEventRunModal + 139
frame #57: 0x00007fff24675187 UIKitCore-[UIApplication _run] + 912UIApplicationMain + 101
frame #59: 0x00000001008dfdab XXXmain at AppDelegate.swift:22:7start + 1
frame #61: 0x00007fff20256409 libdyld.dylibstart + 1Hi @alperkayabasi , @ishch , can you remove the call of activateapp and use following in application:didFinishLaunchingWithOptions: instead to see if the issue can be fixed? Thanks
[[FBSDKApplicationDelegate sharedInstance] application:application
didFinishLaunchingWithOptions:launchOptions];
The reason is that FBSDK v9.0.0 removes the auto init of SDK and it's required to initialize the SDK explicitly with the initializeSDK method or implicitly by calling it in applicationDidFinishLaunching before calling activateApp
This is still crashing app after trying both implementations and removing activateApp.
Previous FB SDK version was 6.5.2
pod 'FBSDKCoreKit/Swift', '6.5.2'
New one
pod 'FBSDKCoreKit', '9.0.0'
Most helpful comment
Hi @alperkayabasi , @ishch , can you remove the call of activateapp and use following in application:didFinishLaunchingWithOptions: instead to see if the issue can be fixed? Thanks