2016-12-09 2 views
7

So repliziere ich den Fehler. Also hier ist der Code, den ich in für die Anmeldung habe:Facebook sdk stürzt in Anwendungsdelegaten ab

@IBAction func FBLoginAction(_ sender: AnyObject) { 
    fbLoginManager.loginBehavior = FBSDKLoginBehavior.browser 
    fbLoginManager.logIn(withReadPermissions: ["public_profile", "email", "user_friends"], from: self) { (result, error) -> Void in 
     if (error != nil) { 
      return 
     } 
    } 
} 

Wenn ich zweimal anmelden und dann wieder die App läuft, stürzt diese Zeile in der AppDelegate.

FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions) 

Wenn ich mich nur einmal anmelde und die App erneut starte, passiert kein Absturz. Der vollständige Stapel für den Absturz ist der folgende:

2016-12-09 10: 51: 28,893 Persistence [73125: 897290] - [NSConcreteMutableData isEqualToString:]: Unbekannter Selektor gesendet Instanz 0x60000004ec40 2016-12- 09 10: 51: 28,903 Persistence [73125: 897.290] *** Beenden app aufgrund nicht abgefangene Ausnahme 'NSInvalidArgumentException', Grund: '- [NSConcreteMutableData isEqualToString]: Unbekannter Selektor zum Beispiel 0x60000004ec40 gesendet'

*** Erster Aufrufstapel: (0 CoreFoundation 0x00000001085e634b excepti onPreprocess + 171 1 libobjc.A.dylib
0x0000000107c2a21e objc_exception_throw + 48 2 Corefoundation
0x0000000108655f34 - [NSObject (NSObject) doesNotRecognizeSelector:] + 132 3 Corefoundation 0x000000010856bc15 ___forwarding_
+ 1013 4 Corefoundation 0x000000010856b798 _CF_forwarding_prep_0 + 120 5 FBSDKCoreKit
0x000000010700aa5a - [FBSDKAccessTokenCacheV4 fetchAccessToken] + 202 6 FBSDKCoreKit 0x000000010700902c - [FBSDKAccessTokenCache fetchAccessToken] + 92 7 FBSDKCoreKit 0x0000000107017d2d - [FBSDKApplicationDelegate Anwendung: didFinishLaunchingWithOptions:] + 125 8 Persistence
0x000000010572bcb7 _TFC11Persistence11AppDelegate11applicationfTCSo13UIApplication29didFinishLaunchingWithOptionsGSqGVs10DictionaryVSC29UIApplicationLaunchOptionsKeyP____Sb + 727 9 Persistence 0x000000010572cfb4 _TToFC11Persistence11AppDelegate11applicationfTCSo13UIApplication29didFinishLaunchingWithOptionsGSqGVs10DictionaryVSC29UIApplicationLaunchOptionsKeyP____Sb + 180 10 UIKit 0x00000001091110be - [UIApplication _handleDelegateCallbacksWithOptions: isSuspended: restore:] + 290 11 UIKit 0x0000000109112a43 - [UIApplication _callInitializationDelegatesForMainScene: transitionContext:] + 4236 12 UIKit 0x0000000109118de9 - [UIApplication _runWithMainScene: transitionContext: Vervollständigung:] + 1731 13 UIKit 0x0000000109115f69 - [UIApplication workspaceDidEndTransac tion:] + 188 14 FrontBoardServices 0x000000010d698723 FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK + 24 15 FrontBoardServices 0x000000010d69859c - [FBSSerialQueue _performNext] + 189 16 FrontBoardServices 0x000000010d698925 - [FBSSerialQueue _performNextFromRunLoopSource] + 45 17 Corefoundation 0x000000010858b311 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17 18 Corefoundation 0x000000010857059c __CFRunLoopDoSources0 + 556 19 CoreFoundation 0x000000010856fa86 __CFRunLoopRun + 918 20 CoreFoundation
0x000000010856f494 CFRunLoopRunSpecific + 420 21 UIKit
0x0 0000001091147e6 - [UIApplication _run] + 434 22 UIKit
0x000000010911a964 UIApplicationMain + 159 23 Persistence
0x000000010572d97f Haupt + 111 24 libdyld.dylib
0x000000010b3a368d + 1 beginnen) libC++ abi.dylib: mit abgefangene Ausnahme des Typs NSException Abschluß

Antwort

10

Ich kehrte zu Version 4.17.0 des Facebook SDK zurück und ich bekomme nicht mehr den Absturz.

+0

Ich bekomme den gleichen Absturz.nur um zu bestätigen, ist die Absturzversion 4.18.0? – AmitP

+0

Das ist lächerlich. Vielen Dank für die Lösung, hoffentlich wird Facebook ein aktuelles Swift-basiertes SDK mit voller Funktionalität veröffentlichen ... – the4kman

+0

Scheint in 4.19.0 behoben – paiv

2

Wenn Sie Version 4.18.0 des Facebook SDK verwenden, dann aktualisieren Sie es auf 4.19.0 oder auf die aktuelle Version und Sie werden den Absturz nicht bekommen.

0

Achten Sie darauf, keine eingeschränkte Versionen von FBSDK in Ihrem Podfile haben, etwa so:

pod 'FBSDKCoreKit' 
pod 'FBSDKLoginKit' 
pod 'FBSDKShareKit' 

Dann machen Sie die pod update. Legen Sie keine --no-repo-update, um Ihre lokalen Spezifikationen Repos aktualisiert werden zu lassen.

Neueste lokale Specs-Repositories können Sie die neueste Version von FBSDK herunterladen, die die 4.19.0 ist.