gpt4 book ai didi

objective-c - GAIUncaughtExceptionHandler 仅在 iOS 7 下崩溃

转载 作者:太空狗 更新时间:2023-10-30 03:22:22 24 4
gpt4 key购买 nike

试图压缩我们更持久的崩溃报告之一。可疑,因为它完全是 iOS 7.*,不清楚触发因素是什么,这在我们遇到问题的用户中所占比例相对较小。感觉像是竞争条件或 iOS 7.* 特定于 Google Analytics SDK 的错误。我与 SDK 的交互非常简单:

+ (void)trackEvent:(NSString *)category action:(NSString *)action label:(NSString *)label value:(NSNumber *)value
{
// May return nil if a tracker has not already been initialized with a
// property ID.
id tracker = [[GAI sharedInstance] defaultTracker];

[tracker send:[[GAIDictionaryBuilder createEventWithCategory:category
action:action
label:label
value:value] build]];
}


+ (void)trackScreenView:(NSString *)screenName
{
// https://developers.google.com/analytics/devguides/collection/ios/v3/screens

// May return nil if a tracker has not already been initialized with a
// property ID.
id tracker = [[GAI sharedInstance] defaultTracker];

// This screen name value will remain set on the tracker and sent with
// hits until it is set to a new value or to nil.
[tracker set:kGAIScreenName
value:screenName];

// Previous V3 SDK versions
// [tracker send:[[GAIDictionaryBuilder createAppView] build]];

// New SDK versions
[self visuallyLogTrackingDetails:tracker dictionaryBuilder:[GAIDictionaryBuilder createScreenView]];
}

在某些情况下,我会向调用传递更多数据(除了屏幕名称),例如:

+ (void)trackGenderedScreenView:(MyAppGender)gender
{
id tracker = [[GAI sharedInstance] defaultTracker];

[tracker set:kGAIScreenName
value:MyAppAnalyticsGenderedScreenName];

GAIDictionaryBuilder *dictionaryBuilder = [GAIDictionaryBuilder createScreenView];
[dictionaryBuilder set:[MyAppUtil getGenderedString:gender]
forKey:[GAIFields customDimensionForIndex:ASPAnalyticsDimensionGender]];

[self visuallyLogTrackingDetails:tracker dictionaryBuilder:dictionaryBuilder];
}

SDK 版本:谷歌分析服务 iOS 3.10

影响:仅限于 iOS 7.*。

Crashlytics issue summary

示例堆栈跟踪

Thread : Crashed: com.apple.main-thread
0 libsystem_kernel.dylib 0x000000019333258c __pthread_kill + 8
1 libsystem_pthread.dylib 0x00000001933b516c pthread_kill + 104
2 libsystem_c.dylib 0x00000001932c6808 abort + 112
3 libc++abi.dylib 0x00000001924ec994 __cxa_bad_cast
4 libc++abi.dylib 0x0000000192509c2c default_unexpected_handler()
5 libobjc.A.dylib 0x0000000192c444d4 _objc_terminate() + 128
6 libc++abi.dylib 0x0000000192507168 std::__terminate(void (*)()) + 16
7 libc++abi.dylib 0x0000000192506a80 __cxxabiv1::exception_cleanup_func(_Unwind_Reason_Code, _Unwind_Exception*)
8 libobjc.A.dylib 0x0000000192c44318 _objc_exception_destructor(void*)
9 CoreFoundation 0x000000018673e890 -[NSException initWithCoder:]
10 Foundation 0x00000001872286a8 -[NSISEngine minimizeConstantInObjectiveRowWithHead:] + 236
11 Foundation 0x00000001872281ac -[NSISEngine optimize] + 188
12 Foundation 0x000000018722384c -[NSISEngine withBehaviors:performModifications:] + 232
13 UIKit 0x0000000189827488 -[UIWindow(UIConstraintBasedLayout) updateConstraintsIfNeeded] + 228
14 UIKit 0x000000018978ac78 -[UIWindow(UIConstraintBasedLayout) layoutSublayersOfLayer:] + 92
15 QuartzCore 0x00000001892f4258 -[CALayer layoutSublayers] + 184
16 QuartzCore 0x00000001892eee20 CA::Layer::layout_if_needed(CA::Transaction*) + 300
17 QuartzCore 0x00000001892eecd8 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 32
18 QuartzCore 0x00000001892ee560 CA::Context::commit_transaction(CA::Transaction*) + 280
19 QuartzCore 0x00000001892ee304 CA::Transaction::commit() + 424
20 QuartzCore 0x00000001892e7c38 CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 80
21 CoreFoundation 0x00000001866ff0a8 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
22 CoreFoundation 0x00000001866fc330 __CFRunLoopDoObservers + 372
23 CoreFoundation 0x00000001866fc6bc __CFRunLoopRun + 764
24 CoreFoundation 0x000000018663d6d0 CFRunLoopRunSpecific + 452
25 MyApp 0x000000010051ff84 GAIUncaughtExceptionHandler
26 CoreFoundation 0x000000018673ece8 __handleUncaughtException + 644
27 libobjc.A.dylib 0x0000000192c444c8 _objc_terminate() + 116
28 libc++abi.dylib 0x0000000192507168 std::__terminate(void (*)()) + 16
29 libc++abi.dylib 0x00000001925071d8 std::terminate() + 64
30 libobjc.A.dylib 0x0000000192c4442c _destroyAltHandlerList
31 libdispatch.dylib 0x000000019321bfe8 _dispatch_client_callout + 36
32 libdispatch.dylib 0x000000019321f1dc _dispatch_main_queue_callback_4CF + 336
33 CoreFoundation 0x00000001866fe62c __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
34 CoreFoundation 0x00000001866fc96c __CFRunLoopRun + 1452
35 CoreFoundation 0x000000018663d6d0 CFRunLoopRunSpecific + 452
36 GraphicsServices 0x000000018c321c0c GSEventRunModal + 168
37 UIKit 0x000000018976efdc UIApplicationMain + 1156
38 MyApp 0x0000000100156a48 main (main.m:14)
39 libdyld.dylib 0x0000000193237aa0 start + 4

最佳答案

通过阅读崩溃报告,我注意到布局约束存在问题。由于布局限制,我在 iOS 7 中也遇到过类似的问题。问题可能是使用比例宽度/高度自动布局约束,因为它们在 iOS 7 中无法正常工作。

关于objective-c - GAIUncaughtExceptionHandler 仅在 iOS 7 下崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29683149/

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