- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我们正在经历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/
我只是创建了一个新的单 View 应用程序,并在 ViewController.m 文件中编写了三个函数。 -(BOOL)shouldAutorotate { return YES; } -(
我有一个场景,其中我有一个带有 5 个选项卡的 UITabbarController。每个选项卡都包含一个 UINavigationController。 现在在 UINavigationContro
我试图以编程方式强制一个弹出 View 为横向,同时我在项目设置中将应用程序的设备方向设置为纵向。我的代码如下所示: override func shouldAutorotate() -> Bool
我正在使用 iOS 8 的 UIPresentationController 编写自定义模式演示文稿。呈现的 Controller 具有首选界面方向 UIInterfaceOrientationLan
此错误没有意义,因为首选方向 UIInterfaceOrientationLandscapeRight 由支持的方向返回 //iOS6 -(BOOL)shouldAutorotate { re
我的应用程序窗口的 Root View Controller 是 UINavigationController 的子类。我已将此代码添加到类(class)中: - (BOOL)shouldAutoro
我们正在经历this crash来自 GoogleSignIn iOS 框架 v4.0.1(通过 CocoaPods 链接)。 致命异常:UIApplicationInvalidInterfaceOr
我正在使用 MSNavigationPaneViewController from here并进行轮换工作。我已经覆盖了根 UINavigationController 中的旋转方法 -(BOOL)s
我在尝试阻止某些 View 中的方向时遇到问题,但代码不起作用。 我在每个 View 中都使用这条线: - (BOOL)shouldAutorotate { return YES; } - (
我是一名优秀的程序员,十分优秀!