facebook sdk在应用程序委托中崩溃

loading...


7

这是我复制bug的方法 . 所以这是我登录的代码:

@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
        }
    }
 }

如果我登录两次,然后再次运行该应用程序,此行将在appdelegate中崩溃 .

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

如果我只登录一次,然后再次运行应用程序,则不会发生崩溃 . 崩溃的完整堆栈如下:

2016-12-09 10:51:28.893持久性[73125:897290] - [NSConcreteMutableData isEqualToString:]:无法识别的选择器发送到实例0x60000004ec40 2016-12-09 10:51:28.903持久性[73125:897290] ***终止应用程序由于未捕获的异常'NSInvalidArgumentException',原因:' - [NSConcreteMutableData isEqualToString:]:无法识别的选择器发送到实例0x60000004ec40'***第一次抛出调用堆栈:(0 CoreFoundation 0x00000001085e634b exceptionPreprocess 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应用:didFinishLaun chingWithOptions:] 125 8持久性0x000000010572bcb7 _TFC11Persistence11AppDelegate11applicationfTCSo13UIApplication29didFinishLaunchingWithOptionsGSqGVs10DictionaryVSC29UIApplicationLaunchOptionsKeyP____Sb 727 9持久0x000000010572cfb4 _TToFC11Persistence11AppDelegate11applicationfTCSo13UIApplication29didFinishLaunchingWithOptionsGSqGVs10DictionaryVSC29UIApplicationLaunchOptionsKeyP____Sb 180 10的UIKit 0x00000001091110be - [UIApplication的_handleDelegateCallbacksWithOptions:isSuspended:restoreState:] 290 11的UIKit 0x0000000109112a43 - [UIApplication的_callInitializationDelegatesForMainScene:transitionContext:] 4236 12的UIKit 0x0000000109118de9 - [UIApplication的_runWithMainScene:transitionContext:完成:] 1731 13 UIKit 0x0000000109115f69 - [UIApplication workspaceDidEndTransaction:] 188 14 FrontBoardServices 0x000000010d698723 FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK 24 15 FrontBoardServices 0x000000010d69859c - [FBSSerialQueue _performNext] 189 16 FrontBoardServi CES 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 0x00000001091147e6 - [UIApplication的_run] 434 22的UIKit 0x000000010911a964 UIApplicationMain 159 23持久性0x000000010572d97f主111 24 libdyld . dylib 0x000000010b3a368d start 1)libc abi.dylib:以NSException类型的未捕获异常终止

3回答

  • 10

    我恢复到Facebook SDK的4.17.0版本,我不再受到崩溃 .


  • 0

    如果您使用的是Facebook SDK版本4.18.0,则将其更新为4.19.0或当前版本,您将无法获得崩溃 .


  • 2

    确保 Podfile 中没有受限制的 FBSDK 版本,如下所示:

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

    然后做 pod update . 不要放 --no-repo-update 让你的本地规格repos更新 .

    最新的本地规格存储库将让您能够下载 FBSDK 的最新版本,即 4.19.0 .

loading...

评论

暂时没有评论!