facebook-ios-sdk
facebook-ios-sdk copied to clipboard
App is crashing with issue [FBSDKBasicUtility _convertObjectToJSONObject:invalidObjectHandler:stop:]
Checklist before submitting a bug report
- [X] I've updated to the latest released version of the SDK
- [X] I've searched for existing GitHub issues
- [X] I've looked for existing answers on Stack Overflow, the Facebook Developer Community Forum and the Facebook Developers Group
- [X] I've read the Code of Conduct
- [X] This issue is not security related and can safely be disclosed publicly on GitHub
Xcode version
14.2
Facebook iOS SDK version
16.1.3
Dependency Manager
CocoaPods
SDK Framework
Login
Goals
I am trying to update my apps and after I release to test flight it is crashing. Debugging the crash log and this is what I have found
Also find screenshot for reference
Video issue
https://github.com/facebook/facebook-ios-sdk/assets/34439120/1b0b5178-a932-470b-b105-6a143bd7805e
Expected results
It should not crash when initialising Facebook SDK. If I remove below line from AppDelegate.m, it works fine.
[[FBSDKApplicationDelegate sharedInstance] application:application didFinishLaunchingWithOptions:launchOptions];
But then, I have to remove Facebook login from my app.
Actual results
Currently app is crashing with below crash log, this crash is happening at initial launch as shown in video.
FBSDKCoreKit_Basics +[FBSDKBasicUtility _convertObjectToJSONObject:invalidObjectHandler:stop:] FBSDKBasicUtility.m:128 FBSDKCoreKit_Basics +[FBSDKBasicUtility _convertObjectToJSONObject:invalidObjectHandler:stop:] FBSDKBasicUtility.m:120 FBSDKCoreKit_Basics +[FBSDKBasicUtility JSONStringForObject:error:invalidObjectHandler:] FBSDKBasicUtility.m:59 FBSDKCoreKit -[FBSDKAppEventsUtility activityParametersDictionaryForEvent:shouldAccessAdvertisingID:userID:userData:] FBSDKAppEventsUtility.m:127 FBSDKCoreKit -[FBSDKAppEvents publishInstall] FBSDKAppEvents.m:866 FBSDKCoreKit -[FBSDKAppEvents fetchServerConfiguration:] FBSDKAppEvents.m:1023 FBSDKCoreKit -[FBSDKServerConfigurationManager _didProcessConfigurationFromNetwork:appID:error:] FBSDKServerConfigurationManager.m:387 FBSDKCoreKit -[FBSDKServerConfigurationManager processLoadRequestResponse:error:appID:] FBSDKServerConfigurationManager.m:281 FBSDKCoreKit -[FBSDKGraphRequestPiggybackManager addServerConfigurationPiggyback:] FBSDKGraphRequestPiggybackManager.m:178 FBSDKCoreKit -[FBSDKGraphRequestMetadata invokeCompletionHandlerForConnection:withResults:error:] FBSDKGraphRequestMetadata.m:32 FBSDKCoreKit -[FBSDKGraphRequestConnection processResultBody:error:metadata:canNotifyDelegate:] FBSDKGraphRequestConnection.m:998 FBSDKCoreKit -[FBSDKGraphRequestConnection processResultBody:error:metadata:canNotifyDelegate:] FBSDKGraphRequestConnection.m:1032 FBSDKCoreKit -[FBSDKGraphRequestConnection _completeWithResults:networkError:] FBSDKGraphRequestConnection.m:981 CoreFoundation NSARRAY_IS_CALLING_OUT_TO_A_BLOCK
Steps to reproduce
We have an existing Facebook developer id that is causing this issue. We are not sure if this will happen for new developers who are going to integrate Facebook in their app. We are using Objective-c file for App Delegate.
Code samples & details
// INSERT YOUR CODE HERE
var example = "Example code"