You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue is not security related and can safely be disclosed publicly on GitHub
Environment
Describe your dev environment here, giving as many details as possible. If you have them, make sure to include:
Xcode Version: Any
Swift Version: Any
Installation Platform & Verison: Any
Goals
Upgrade to v11 and run the application without a crash.
Expected Results
What do you expect to happen?
Actual Results
SDK crashes:
libc++abi: terminating with uncaught exception of type NSException
*** Terminating app due to uncaught exception 'InvalidOperationException', reason: 'As of v9.0, you must initialize the SDK prior to calling any methods or setting any properties. You can do this by calling `FBSDKApplicationDelegate`'s `application:didFinishLaunchingWithOptions:` method.Learn more: https://developers.facebook.com/docs/ios/getting-started'
terminating with uncaught exception of type NSException
Steps to Reproduce
Call a method or access or set a property before calling application:didFinishLaunchingWithOptions:.
func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
Settings.appID = "foo" // MOVE THIS LINE TO BE AFTER SDK INITIALIZATION
ApplicationDelegate.shared.application(
application,
didFinishLaunchingWithOptions: launchOptions
)
return true
}
jawwad
changed the title
Why is the SDK Crashing at runtime after upgrading to v11?
Why is the SDK Crashing at runtime after upgrading to v11? (Solution Included)
Jun 9, 2021
But what about the app extension? In extension there's no AppDelegate and therefore I'm not able to pass anything to ApplicationDelegate.shared.application and therefore the extension keeps crashing on v11.
But what about the app extension? In extension there's no AppDelegate and therefore I'm not able to pass anything to ApplicationDelegate.shared.application and therefore the extension keeps crashing on v11.
We are reintroducing the ability to initialize the SDK without an AppDelegate #1793
As far as extensions go, this was never explicitly supported and will require some effort to come up with a good way to support this. It's not entirely unlikely, based on how Xcode 13 handles NS_EXTENSION_UNAVAILABLE with regard to Swift Package Manager, that the SDK will break in extensions for other modes of building in the future. See: #1811
Checklist
Environment
Describe your dev environment here, giving as many details as possible. If you have them, make sure to include:
Goals
Upgrade to v11 and run the application without a crash.
Expected Results
What do you expect to happen?
Actual Results
SDK crashes:
Steps to Reproduce
Call a method or access or set a property before calling
application:didFinishLaunchingWithOptions:
.Solution:
The text was updated successfully, but these errors were encountered: