12

试图压缩我们更持久的崩溃报告之一。可疑,因为它仅适用于 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 问题摘要

示例堆栈跟踪

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
4

1 回答 1

2

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

于 2015-06-17T06:17:17.363 回答