Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Сrash on first initialization FBSDKAppEvents #1683

Closed
5 tasks done
ArthurNarimanov opened this issue Mar 11, 2021 · 2 comments
Closed
5 tasks done

Сrash on first initialization FBSDKAppEvents #1683

ArthurNarimanov opened this issue Mar 11, 2021 · 2 comments

Comments

@ArthurNarimanov
Copy link

ArthurNarimanov commented Mar 11, 2021

Сrash on first initialization FBSDKAppEvents

When updating the SDK to version 9.0.1, the application crashed on the first launch, there are no subsequent crashes.

Checklist

Environment

Describe your dev environment here, giving as many details as possible. If you have them, make sure to include:

  • Xcode Version: 12.4
  • Swift Version: 5 (if issue is Swift related)
  • Installation Platform & Verison: [Cocoapods] version 1.10.1

Goals

Correct work SDK

Expected Results

Bug fix

Actual Results

0 0x0000000115b67613 in _dispatch_once_wait.cold.1 ()
1 0x0000000115b352bc in _dispatch_once_wait ()
2 0x000000011378aa24 in _dispatch_once [inlined] at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/dispatch/once.h:84
3 0x000000011378a987 in +[FBSDKAppEvents singleton] at /Users/arthurnarimanov/Project/project-ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/AppEvents/FBSDKAppEvents.m:929
4 0x000000011378a696 in +[FBSDKAppEvents logInternalEvent:valueToSum:parameters:isImplicitlyLogged:accessToken:] at /Users/arthurnarimanov/Project/project-ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/AppEvents/FBSDKAppEvents.m:905
5 0x000000011378a2dd in +[FBSDKAppEvents logInternalEvent:parameters:isImplicitlyLogged:] at /Users/arthurnarimanov/Project/project-ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/AppEvents/FBSDKAppEvents.m:867
6 0x0000000113886459 in +[FBSDKSettings logIfSDKSettingsChanged] at /Users/arthurnarimanov/Project/project-ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKSettings.m:458
7 0x000000011388208e in +[FBSDKSettings initialize] at /Users/arthurnarimanov/Project/project-ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKSettings.m:106
8 0x00007fff20178453 in CALLING_SOME
+initialize_METHOD ()
9 0x00007fff20179326 in initializeNonMetaClass ()
10 0x00007fff2017a3ad in initializeAndMaybeRelock(objc_class*, objc_object*, mutex_tt&, bool) ()
11 0x00007fff20185b8f in lookUpImpOrForward ()
12 0x00007fff2017421b in _objc_msgSend_uncached ()
13 0x000000011379257f in +[FBSDKAppEventsConfigurationManager loadAppEventsConfigurationWithBlock:] at /Users/arthurnarimanov/Project/project-ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/AppEvents/Internal/FBSDKAppEventsConfigurationManager.m:61
14 0x000000011378cb9b in -[FBSDKAppEvents fetchServerConfiguration:] at /Users/arthurnarimanov/Project/project-ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/AppEvents/FBSDKAppEvents.m:1082
15 0x00000001137870c9 in -[FBSDKAppEvents init] at /Users/arthurnarimanov/Project/project-ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/AppEvents/FBSDKAppEvents.m:375
16 0x000000011378aabc in __27+[FBSDKAppEvents singleton]_block_invoke at /Users/arthurnarimanov/Project/project-ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/AppEvents/FBSDKAppEvents.m:930
17 0x0000000115b349c8 in _dispatch_client_callout ()
18 0x0000000115b35f33 in dispatch_once_callout ()
19 0x000000011378aa24 in dispatch_once [inlined] at /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/usr/include/dispatch/once.h:84
20 0x000000011378a987 in +[FBSDKAppEvents singleton] at /Users/arthurnarimanov/Project/project-ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/AppEvents/FBSDKAppEvents.m:929
21 0x000000011378777e in +[FBSDKAppEvents logEvent:valueToSum:parameters:accessToken:] at /Users/arthurnarimanov/Project/project-ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/AppEvents/FBSDKAppEvents.m:448
22 0x00000001137875c1 in +[FBSDKAppEvents logEvent:parameters:] at /Users/arthurnarimanov/Project/project-ios/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/AppEvents/FBSDKAppEvents.m:427
23 0x000000010bb07b8e in +[StatisticsAdapterFBSDK logContentViewed:] at /Users/arthurnarimanov/Project/project-ios/projectApp/Sources/Statistics/FBStatistics/StatisticsAdapterFBSDK.m:38
24 0x000000010c0a5ad8 in ***tPresenter.viewWillAppear() at /Users/arthurnarimanov/Project/project-ios/projectApp/*Presenter.swift:117
25 0x000000010c0ac38e in protocol witness for BaseViewOutConnection.viewWillAppear() in conformance *Presenter ()
26 0x000000010c899544 in **ViewController.viewWillAppear(
:) at /Users/arthurnarimanov/Project/project-ios/projectApp/*ViewController.swift:71
27 0x000000010c8995f8 in @objc *ViewController.viewWillAppear(
:) ()
28 0x00007fff23f68c66 in -[UIViewController _setViewAppearState:isAnimating:] ()
29 0x00007fff23f6948f in -[UIViewController __viewWillAppear:] ()
30 0x00007fff23e98440 in -[UINavigationController _startTransition:fromViewController:toViewController:] ()
31 0x00007fff23e9927d in -[UINavigationController _startDeferredTransitionIfNeeded:] ()
32 0x00007fff23e9a5e8 in -[UINavigationController __viewWillLayoutSubviews] ()
33 0x00007fff23e7ad9e in -[UILayoutContainerView layoutSubviews] ()
34 0x00007fff24bf8504 in -[UIView(CALayerDelegate) layoutSublayersOfLayer:] ()
35 0x00007fff27b1bc2b in -[CALayer layoutSublayers] ()
36 0x00007fff27b2219d in CA::Layer::layout_if_needed(CA::Transaction*) ()
37 0x00007fff27b2df3f in CA::Layer::layout_and_display_if_needed(CA::Transaction*) ()
38 0x00007fff27a6d44c in CA::Context::commit_transaction(CA::Transaction*, double, double*) ()
39 0x00007fff27aa4233 in CA::Transaction::commit() ()
40 0x00007fff246c72fb in _afterCACommitHandler ()
41 0x00007fff2038f1f8 in CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION ()
42 0x00007fff20389a77 in __CFRunLoopDoObservers ()
43 0x00007fff2038a01a in __CFRunLoopRun ()
44 0x00007fff203896d6 in CFRunLoopRunSpecific ()
45 0x00007fff2c257db3 in GSEventRunModal ()
46 0x00007fff24696cf7 in -[UIApplication _run] ()
47 0x00007fff2469bba8 in UIApplicationMain ()
48 0x000000010c6de2db in main at /Users/arthurnarimanov/Project/project-ios/ProjectApp/GlobalObjects/AppDelegate.swift:24
49 0x00007fff2025a3e9 in start ()

Steps to Reproduce

  1. Set
    [FBSDKAppEvents logEvent:FBSDKAppEventNameViewedContent parameters:@{FBSDKAppEventParameterNameContentType: contentType}];
  1. Run the application for the first time
  2. Get crash
  3. Run the application a second time - no crash

Code Samples & Details

+ (FBSDKAppEvents *)singleton
{
  static dispatch_once_t onceToken;
  static FBSDKAppEvents *shared = nil;
  dispatch_once(&onceToken, ^{ // Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)
    shared = [[self alloc] init]; 
  });
  return shared;
}
@joesus
Copy link
Contributor

joesus commented Mar 11, 2021

You will need to initialize the SDK before calling any methods. This is in the documentation and the release notes for v9. Is this the reason for the crash? If not please update the issue with reproducible sample. Thanks!

@ArthurNarimanov
Copy link
Author

Thank! I have updated the FB SDK from "5.15.1" to "9.0.1" and am getting a crash.
Need to add to AppDelegate

ApplicationDelegate.shared.application(application,
                                       didFinishLaunchingWithOptions: launchOptions)

and

ApplicationDelegate.shared.application(app,
                                       open: url,
                                       sourceApplication: options[UIApplication.OpenURLOptionsKey.sourceApplication] as? String,
                                       annotation: options[UIApplication.OpenURLOptionsKey.annotation])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants