首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >NSInvalidArgumentException在SwiftUI中使用google时来自OIDAuthorizationService的

NSInvalidArgumentException在SwiftUI中使用google时来自OIDAuthorizationService的
EN

Stack Overflow用户
提问于 2020-08-15 00:28:01
回答 3查看 653关注 0票数 3

这个陌生的错误使我今天过得很糟糕

代码语言:javascript
复制
    2020-08-15 10:00:38.630941+0100 Wicrypt[44349:3718177] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[OIDAuthorizationService presentAuthorizationRequest:presentingViewController:callback:]: unrecognized selector sent to class 0x106b47af0'
*** First throw call stack:
(
    0   CoreFoundation                      0x0000000107dfb4b2 __exceptionPreprocess + 242
    1   libobjc.A.dylib                     0x0000000107a4b26e objc_exception_throw + 48
    2   CoreFoundation                      0x0000000107e09f12 __CFExceptionProem + 0
    3   CoreFoundation                      0x0000000107dff9e8 ___forwarding___ + 1479
    4   CoreFoundation                      0x0000000107e01a18 _CF_forwarding_prep_0 + 120
    5   Wicrypt                             0x0000000106aac8d2 -[GIDSignIn authenticateInteractivelyWithOptions:] + 626
    6   Wicrypt                             0x0000000106aacd5f -[GIDSignIn authenticateWithOptions:] + 74
    7   Wicrypt                             0x0000000106aac59a -[GIDSignIn signInWithOptions:] + 509
    8   Wicrypt                             0x0000000106aabde6 -[GIDSignIn signIn] + 64
    9   Wicrypt                             0x000000010671810b $s7Wicrypt18GoogleSignInScreenV4bodyQrvg7SwiftUI9TupleViewVyAE0J0PAEE5frame5width6height9alignmentQr12CoreGraphics7CGFloatVSg_AqE9AlignmentVtFQOyAE6SpacerV_Qo__AiEEAjklMQrAQ_AqStFQOyAE6VStackVyAGyAE4TextV_AZtGG_Qo_AuzE6ButtonVyAZGtGyXEfU_yycfU0_ + 91
    10  SwiftUI                             0x00000001095e1d91 $s7SwiftUI18WrappedButtonStyle33_AEEDD090E917AC57C12008D974DC6805LLV4BodyV4bodyQrvgyycAA09PrimitivedE13ConfigurationVcfu_yycfu0_TA + 17
    11  SwiftUI                             0x000000010989c000 $s7SwiftUI25PressableGestureCallbacksV8dispatch5phase5stateyycSgAA0D5PhaseOyxG_SbztFyycfU_ + 32
    12  SwiftUI                             0x0000000109657bac $sIeg_ytIegr_TR + 12
    13  SwiftUI                             0x00000001094dc901 $sIeg_ytIegr_TRTA + 17
    14  SwiftUI                             0x00000001094fbcd9 $sIeg_ytIegr_TRTA.1980 + 9
    15  SwiftUI                             0x0000000109657bcc $sytIegr_Ieg_TR + 12
    16  SwiftUI                             0x0000000109657bac $sIeg_ytIegr_TR + 12
    17  SwiftUI                             0x000000010964a791 $sIeg_ytIegr_TRTA + 17
    18  SwiftUI                             0x000000010964a044 $s7SwiftUI6UpdateO3endyyFZ + 436
    19  SwiftUI                             0x0000000109688a9d $s7SwiftUI19EventBindingManagerC4sendyySDyAA0C2IDVAA0C4Type_pGF + 301
    20  SwiftUI                             0x0000000109ac2a9c $s7SwiftUI18EventBindingBridgeC4send_6sourceySDyAA0C2IDVAA0C4Type_pG_AA0cD6Source_ptFTf4nen_nAA22UIKitGestureRecognizerC_Tg5 + 2060
    21  SwiftUI                             0x0000000109ac0782 $s7SwiftUI22UIKitGestureRecognizerC4send025_062C14327F4C9197D92807A7H6DF7F3BLL7touches5event5phaseyShySo7UITouchCG_So7UIEventCAA10EventPhaseOtF + 66
    22  SwiftUI                             0x0000000109ac15e3 $s7SwiftUI22UIKitGestureRecognizerC12touchesBegan_4withyShySo7UITouchCG_So7UIEventCtFToTm + 131
    23  SwiftUI                             0x0000000109ac0858 $s7SwiftUI22UIKitGestureRecognizerC12touchesEnded_4withyShySo7UITouchCG_So7UIEventCtFTo + 40
    24  UIKitCore                           0x000000011388b2f5 -[UIGestureRecognizer _componentsEnded:withEvent:] + 217
    25  UIKitCore                           0x0000000113dd2162 -[UITouchesEvent _sendEventToGestureRecognizer:] + 674
    26  UIKitCore                           0x000000011387f6fb __47-[UIGestureEnvironment _updateForEvent:window:]_block_invoke + 70
    27  UIKitCore                           0x000000011387f380 -[UIGestureEnvironment _updateForEvent:window:] + 489
    28  UIKitCore                           0x0000000113d84bb8 -[UIWindow sendEvent:] + 4752
    29  UIKitCore                           0x0000000113d5e7dd -[UIApplication sendEvent:] + 408
    30  UIKitCore                           0x0000000113dee8c0 __processEventQueue + 15007
    31  UIKitCore                           0x0000000113de5398 __eventFetcherSourceCallback + 106
    32  CoreFoundation                      0x0000000107d69b04 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
    33  CoreFoundation                      0x0000000107d69a43 __CFRunLoopDoSource0 + 157
    34  CoreFoundation                      0x0000000107d69187 __CFRunLoopDoSources0 + 222
    35  CoreFoundation                      0x0000000107d63c68 __CFRunLoopRun + 882
    36  CoreFoundation                      0x0000000107d63542 CFRunLoopRunSpecific + 538
    37  GraphicsServices                    0x0000000111c15db3 GSEventRunModal + 139
    38  UIKitCore                           0x0000000113d4014e -[UIApplication _run] + 912
    39  UIKitCore                           0x0000000113d451b1 UIApplicationMain + 101
    40  Wicrypt                             0x00000001066f786b main + 75
    41  libdyld.dylib                       0x000000010e009411 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[OIDAuthorizationService presentAuthorizationRequest:presentingViewController:callback:]: unrecognized selector sent to class 0x106b47af0'
terminating with uncaught exception of type NSException
CoreSimulator 732.7 - Device: iPhone 11 (7A79AEEA-ED4B-4DCD-BC33-81C73615B7A7) - Runtime: iOS 14.0 (18A5332e) - DeviceType: iPhone 11

我已经设置了必要的代表

代码语言:javascript
复制
GIDSignIn.sharedInstance()?.delegate = googleDelegate

我还正确地设置了呈现控制器。

代码语言:javascript
复制
GIDSignIn.sharedInstance()!.presentingViewController = window.rootViewController

我看到的最接近的资源是:08.html#details

请您提供任何帮助或参考资料。

EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2020-08-15 13:00:08

正在调用的方法出现在这个文件中。

如果运行时找不到此方法,则表示该文件未包含到项目中。

如果您正在使用CocoaPods,则此文件应自动包括在内用于ios平台。请确保你指定

代码语言:javascript
复制
platform :ios, '13.0'

在你的Podfile里。

票数 1
EN

Stack Overflow用户

发布于 2020-12-29 17:17:30

如果您不使用豆荚,这可能是文档中的必要步骤:

代码语言:javascript
复制
Add the ObjC linker flag to the app target's build settings:

Other Linker Flags: $(OTHER_LDFLAGS) -ObjC
票数 2
EN

Stack Overflow用户

发布于 2021-06-07 10:32:39

我们不需要在-ObjC中添加OTHER_LINKER_FLAGS,也不需要在应用程序目标的“链接框架和库”中包括AppAuthCore.framework。

仅添加AppAuth.framework就足够了。(并在相关的carthage复制框架中运行脚本阶段。)

(基于AppAuth Git论坛上的瑞特金斯的评论 )

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63421507

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档