gpt4 book ai didi

ios - [iOS 13] : Fatal Exception: NSInvalidArgumentException Can't add self as subview ([NSCache init])

转载 作者:行者123 更新时间:2023-12-01 17:47:29 26 4
gpt4 key购买 nike

我在 Stack Overflow 上看到过类似的问题,但没有帮助。

我使用 Xcode 11 和 iOS 13 SDK 构建了该应用程序。问题是,我只在 iOS 13+ 上遇到所有这些崩溃,即使我的应用程序支持 iOS 10+ 并且其中大约有 50% 的 iOS 12 用户。另外,我无法调试或重现它。

根据此信息,我推断该问题一定是 iOS 13 特有的。最近有人遇到过同样的问题吗?可能的原因、解决办法?

这是来自 Crashlytics 的堆栈跟踪:

Fatal Exception: NSInvalidArgumentException
0 CoreFoundation 0x1c25e1c30 __exceptionPreprocess
1 libobjc.A.dylib 0x1c22fc0c8 objc_exception_throw
2 CoreFoundation 0x1c24d13ac -[NSCache init]
3 UIKitCore 0x1c6b189a8 -[UIView(Internal) _addSubview:positioned:relativeTo:]
4 UIKitCore 0x1c6078bb4 __53-[_UINavigationParallaxTransition animateTransition:]_block_invoke_2
5 UIKitCore 0x1c6b11f60 +[UIView(Animation) performWithoutAnimation:]
6 UIKitCore 0x1c6078630 __53-[_UINavigationParallaxTransition animateTransition:]_block_invoke
7 UIKitCore 0x1c6b1784c +[UIView(Internal) _performBlockDelayingTriggeringResponderEvents:forScene:]
8 UIKitCore 0x1c6078088 -[_UINavigationParallaxTransition animateTransition:]
9 UIKitCore 0x1c606e2b0 ___UIViewControllerTransitioningRunCustomTransition_block_invoke_2
10 UIKitCore 0x1c61822f8 +[UIInputResponderController _pinInputViewsForInputResponderController:onBehalfOfResponder:duringBlock:]
11 UIKitCore 0x1c606e238 ___UIViewControllerTransitioningRunCustomTransition_block_invoke.648
12 UIKitCore 0x1c6b11c0c +[UIView(Animation) _setAlongsideAnimations:toRunByEndOfBlock:]
13 UIKitCore 0x1c606e088 _UIViewControllerTransitioningRunCustomTransition
14 UIKitCore 0x1c5f9d77c -[UINavigationController _startCustomTransition:]
15 UIKitCore 0x1c5fb0c18 -[UINavigationController _startDeferredTransitionIfNeeded:]
16 UIKitCore 0x1c5fb20f8 -[UINavigationController __viewWillLayoutSubviews]
17 UIKitCore 0x1c5f954e0 -[UILayoutContainerView layoutSubviews]
18 UIKitCore 0x1c6b1fabc -[UIView(CALayerDelegate) layoutSublayersOfLayer:]
19 libobjc.A.dylib 0x1c22f7af0 -[NSObject performSelector:withObject:]
20 QuartzCore 0x1c90be0f4 -[CALayer layoutSublayers]
21 QuartzCore 0x1c90be3fc CA::Layer::layout_if_needed(CA::Transaction*)
22 QuartzCore 0x1c90d1964 CA::Layer::layout_and_display_if_needed(CA::Transaction*)
23 QuartzCore 0x1c9016c1c CA::Context::commit_transaction(CA::Transaction*, double)
24 QuartzCore 0x1c9041bd8 CA::Transaction::commit()
25 QuartzCore 0x1c90427ac CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*)
26 CoreFoundation 0x1c255c67c __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__
27 CoreFoundation 0x1c255731c __CFRunLoopDoObservers
28 CoreFoundation 0x1c25578cc __CFRunLoopRun
29 CoreFoundation 0x1c2557098 CFRunLoopRunSpecific
30 GraphicsServices 0x1cc6c1534 GSEventRunModal
31 UIKitCore 0x1c66777ac UIApplicationMain

更新 1:该问题与所有运行 iOS 13 的 iPhone 相关,而不仅仅是 iPhone X(S,R) 系列。

更新 2:该问题也与 iOS 12 相关,但与 iOS 13 相比很少发生崩溃。我的猜测是该问题与使用 iOS 13 SDK 构建项目有关,因为使用 iOS 12 SDK 构建的相同代码不会引发此类崩溃,并且导航逻辑也不会更新。

最佳答案

使用Xcode 11.3iOS SDK 13.3构建的应用程序不再出现此崩溃。我猜这个问题已经在 iOS SDK 端解决了。

更新:2020年6月18日

对于那些仍然遇到问题的人,我建议从旧的 Fabric Crashlytics 更新到新的 Firebase Crashlytics。指南在这里:https://firebase.google.com/docs/crashlytics/upgrade-sdk?platform=ios

此外,我收到了一封来自 Firebase 的关于旧 SDK 弃用的电子邮件:

We are writing to let you know that the Fabric Crashlytics SDK is now deprecated and will continue reporting your app's crashes until November 15, 2020. After this date, the Fabric Crashlytics SDK and beta versions of the Firebase Crashlytics SDK will stop sending crash reports for your app.

关于ios - [iOS 13] : Fatal Exception: NSInvalidArgumentException Can't add self as subview ([NSCache init]),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58321570/

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