gpt4 book ai didi

ios - 谷歌登录 iOS : preferredInterfaceOrientationForPresentation (7) crash

转载 作者:行者123 更新时间:2023-11-29 00:13:01 25 4
gpt4 key购买 nike

我们正在经历this crash来自 GoogleSignIn iOS 框架 v4.0.1(通过 CocoaPods 链接)。

致命异常:UIApplicationInvalidInterfaceOrientation
PreferredInterfaceOrientationForPresentation '(7​​)' 必须与支持的界面方向匹配:'portrait、landscapeLeft、landscapeRight、portraitUpsideDown'!

Fatal Exception: UIApplicationInvalidInterfaceOrientation
0 CoreFoundation 0x184656fe0 __exceptionPreprocess
1 libobjc.A.dylib 0x1830b8538 objc_exception_throw
2 CoreFoundation 0x184656f28 -[NSException initWithCoder:]
3 UIKit 0x18a87cbbc -[UIViewController _preferredInterfaceOrientationForPresentationInWindow:fromInterfaceOrientation:]
4 UIKit 0x18b159cf0 -[_UIFullscreenPresentationController _adjustOrientationIfNecessaryInWindow:forViewController:preservingViewController:]
5 UIKit 0x18aad6d3c -[UIPresentationController _dismissWithAnimationController:interactionController:target:didEndSelector:]
6 UIKit 0x18aafd53c -[UIViewController _dismissViewControllerWithAnimationController:interactionController:completion:]
7 UIKit 0x18a8b2848 -[UIViewController _dismissViewControllerWithTransition:from:completion:]
8 UIKit 0x18a85a6dc -[UIViewController dismissViewControllerWithTransition:completion:]
9 UIKit 0x18a85a4bc -[UIViewController dismissViewControllerWithTransition:completion:]
10 UIKit 0x18aafc7e4 -[UIViewController _performCoordinatedPresentOrDismiss:animated:]
11 UIKit 0x18a85a230 -[UIViewController dismissViewControllerAnimated:completion:]
12 Remind101 0x10069f6a0 -[GIDSignIn dismissViewController:]
13 Remind101 0x100699c4c -[GIDSignIn handleURL:fromGoogleSSOApp:]
14 Remind101 0x100699b60 -[GIDSignIn handleURL:sourceApplication:annotation:]
15 Remind101 0x1001a7398 -[RDAppDelegate application:openURL:options:] (RDAppDelegate.m:495)
16 UIKit 0x18aa13c28 __45-[UIApplication _applicationOpenURL:payload:]_block_invoke
17 UIKit 0x18aa136b0 -[UIApplication _applicationOpenURL:payload:]
18 SafariServices 0x19307a628 -[SFSafariViewController remoteViewController:hostApplicationOpenURL:]
19 SafariServices 0x193072038 -[SFBrowserRemoteViewController willOpenURLInHostApplication:]
20 CoreFoundation 0x18465ce80 __invoking___
21 CoreFoundation 0x1845522c4 -[NSInvocation invoke]
22 FrontBoardServices 0x186200884 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__
23 FrontBoardServices 0x1862006f0 -[FBSSerialQueue _performNext]
24 FrontBoardServices 0x186200aa0 -[FBSSerialQueue _performNextFromRunLoopSource]
25 CoreFoundation 0x18460542c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
26 CoreFoundation 0x184604d9c __CFRunLoopDoSources0
27 CoreFoundation 0x1846029a8 __CFRunLoopRun
28 CoreFoundation 0x184532da4 CFRunLoopRunSpecific
29 GraphicsServices 0x185f9d074 GSEventRunModal
30 UIKit 0x18a7edc9c UIApplicationMain
31 Remind101 0x10015b958 main (main.m:16)
32 libdyld.dylib 0x18354159c start

我们的应用程序委托(delegate)方法(堆栈跟踪中的第 15 帧)实现如下:

- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
{
NSString *sourceApplication = options[UIApplicationOpenURLOptionsSourceApplicationKey];
NSString *annotation = options[UIApplicationOpenURLOptionsAnnotationKey];

// ... bunch of app-specific checks

return [[GIDSignIn sharedInstance] handleURL:url sourceApplication:sourceApplication annotation:annotation];
}

我们的崩溃日志记录显示正在打开的网址如下所示(由于我不知道数字或 uid 是否可以以任何方式识别,因此进行了混淆):

openURL:com.googleusercontent.apps.(number)-(uid):/oauth2callback?code=4/-(uid)# sourceApplication:com.apple.SafariViewService annotation:(null)

我们在过去 7 天内收到了近 300 起此类崩溃。崩溃从 8 月 14 日开始(在 17 日达到峰值),并出现在该日期之前发布的版本中,因此我不认为这是我们通过应用程序引入的任何内容。感谢您的帮助。

最佳答案

从堆栈跟踪来看,崩溃发生在 GoogleSignIn 关闭 SFSafariViewerController 之后。之前的 UIViewController(不是 GoogleSignIn 的一部分)再次暴露,但它为 preferredInterfaceOrientationForPresentation 返回了一个无法识别的值 (7)。请注意,如果 UIViewController 是您的第一个屏幕,则其 preferredInterfaceOrientationForPresentation 可能不会在其初始外观中被调用,而是使用 plist 中的 UISupportedInterfaceOrientations 值。因此,您可能在不知情的情况下从 UIViewController 返回了错误的 UIInterfaceOrientation,直到用户使用 Google 登录后 View 再次出现,导致崩溃。

关于ios - 谷歌登录 iOS : preferredInterfaceOrientationForPresentation (7) crash,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45874310/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com