简体   繁体   English

SWIFT:使用Facebook登录时,“终止于NSException类型的未捕获异常”

[英]SWIFT: “terminating with uncaught exception of type NSException” when sign in with facebook

I'm working in a small application that support users to sign in with Facebook, most of the code that relates to sign in with Facebook I used and referenced from this website 我正在使用一个小型应用程序,该应用程序支持用户使用Facebook登录,这是我从本网站使用并引用的与Facebook登录有关的大多数代码

However, when I compiled the code has an error: 但是,当我编译代码时出现错误:

> 2015-11-06 15:38:38.357 eber_ios[1048:31523] *** Terminating app due
> to uncaught exception 'InvalidOperationException', reason: 'fbauth2 is
> missing from your Info.plist under LSApplicationQueriesSchemes and is
> required for iOS 9.0'
> *** First throw call stack: (     0   CoreFoundation                      0x0000000101369f65 __exceptionPreprocess + 165  1   libobjc.A.dylib   
> 0x0000000103220deb objc_exception_throw + 48  2   eber_ios            
> 0x00000001010d14d1 __56+[FBSDKInternalUtility
> checkRegisteredCanOpenURLScheme:]_block_invoke + 0    3  
> libdispatch.dylib                   0x0000000103d0449b
> _dispatch_client_callout + 8  4   libdispatch.dylib                   0x0000000103cefe28 dispatch_once_f + 543    5   eber_ios                
> 0x00000001010d067f +[FBSDKInternalUtility isFacebookAppInstalled] +
> 241   6   eber_ios                            0x00000001010b65ba
> -[FBSDKLoginManager logInParametersWithPermissions:] + 360    7   eber_ios                            0x00000001010b6991
> -[FBSDKLoginManager logInWithBehavior:] + 50  8   eber_ios                            0x00000001010b6949 -[FBSDKLoginManager logInWithPermissions:handler:]
> + 238     9   eber_ios                            0x00000001010b5667 -[FBSDKLoginManager logInWithReadPermissions:fromViewController:handler:] + 257  10 
> eber_ios                            0x00000001010b2135
> -[FBSDKLoginButton _buttonPressed:] + 1082    11  UIKit                               0x0000000101dab1fa -[UIApplication sendAction:to:from:forEvent:] + 92
>   12  UIKit                               0x0000000101f0f504
> -[UIControl sendAction:to:forEvent:] + 67     13  UIKit                               0x0000000101f0f7d0 -[UIControl _sendActionsForEvents:withEvent:] + 311
>   14  UIKit                               0x0000000101f0e906
> -[UIControl touchesEnded:withEvent:] + 601    15  UIKit                               0x0000000101e15aa3 -[UIWindow _sendTouchesForEvent:] + 835  16  UIKit 
> 0x0000000101e16691 -[UIWindow sendEvent:] + 865   17  UIKit            
> 0x0000000101dc8752 -[UIApplication sendEvent:] + 263  18  UIKit       
> 0x0000000101da3fcc _UIApplicationHandleEventQueue + 6693  19 
> CoreFoundation                      0x00000001012960a1
> __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17   20  CoreFoundation                      0x000000010128bfcc
> __CFRunLoopDoSources0 + 556   21  CoreFoundation                      0x000000010128b483 __CFRunLoopRun + 867     22  CoreFoundation           
> 0x000000010128ae98 CFRunLoopRunSpecific + 488     23  GraphicsServices   
> 0x0000000106816ad2 GSEventRunModal + 161  24  UIKit                   
> 0x0000000101da9676 UIApplicationMain + 171    25  eber_ios              
> 0x00000001010b137d main + 109     26  libdyld.dylib                      
> 0x0000000103d3892d start + 1  27  ???                                
> 0x0000000000000001 0x0 + 1 ) libc++abi.dylib: terminating with
> uncaught exception of type NSException

What causes this error and how can I fix it? 是什么导致此错误,我该如何解决? I'm using FacebookSDK 4.1. 我正在使用FacebookSDK 4.1。

Thank you. 谢谢。

Thanks to Anthony, I added the following key 感谢安东尼,我添加了以下密钥

<key>LSApplicationQueriesSchemes</key>
<array>
    <string>fbauth2</string>
</array>

to info.plist and it worked. 到info.plist,它起作用了。 Thank you. 谢谢。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Swift中的“终止为NSException类型的未捕获异常” - “terminating with uncaught exception of type NSException” in Swift Swift:使用未捕获的异常类型NSException终止应用程序 - Swift: Terminating app with uncaught exception type NSException Swift项目以NSException类型的未捕获异常终止 - Swift Project Terminating with uncaught exception of type NSException Swift:使用NSException类型的未捕获异常终止 - Swift: Terminating with uncaught exception of type NSException 终止类型为NSException的未捕获异常 - terminating uncaught exception of type NSException 以NSException 4类型的未捕获异常终止 - terminating with uncaught exception of type NSException 4 以NSException类型的未捕获异常终止 - terminating with uncaught exception of type NSException 以 NSException 类型的未捕获异常终止 - terminating with uncaught exception of type NSException AppDelegate didFinishLaunchingWithOptions launchOptions-以NSException Swift 3.0类型的未捕获异常终止 - AppDelegate didFinishLaunchingWithOptions launchOptions - terminating with uncaught exception of type NSException Swift 3.0 使用类型NSException定时器Swift崩溃的未捕获异常终止 - Terminating With Uncaught Exception Of Type NSException Timer Swift Crash
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM