【问题标题】:App crashes immediately on start up.. Crash in iOS9 on release only through TestFlight or Store. Distributed with Xcode 8应用程序在启动时立即崩溃。在 iOS9 中仅通过 TestFlight 或 Store 发布时崩溃。随 Xcode 8 分发
【发布时间】:2017-04-20 09:19:32
【问题描述】:

我有一个 iPhone 应用程序在通过 TestFlight 或 App Store 发布后才在 iOS9 设备上崩溃。构建规范是:

部署目标 8.1 基础 SDK:最新 iOS (iOS 10.1)

在我发布崩溃日志之前,我想提一下这个应用程序在过去 2 年中一直在应用程序商店中,并且从未出现过问题。今年我们对应用商店进行了 3 次更新,其中 2 次是在 iOS10 发布之后,iOS9 设备没有出现任何问题。

奇怪的是,我们正在使用 Crashlytics,它报告了超过 600 次崩溃,每一次都是单一的崩溃,指向苹果内部框架或私有 API。我有一个 iOS 9.2.1 设备也崩溃了,我从中提取了日志。他们开始跟随趋势,但我需要一些帮助来破译崩溃的原因。

崩溃 1:

Thread 0 Crashed:
0   libobjc.A.dylib                 0x22fb3af6 objc_msgSend + 22
1   libobjc.A.dylib                 0x22fc0f8a      objc_object::sidetable_release(bool) + 150
2   libobjc.A.dylib                 0x22fc13cc (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 388
3   FrontBoardServices              0x24aebc7e -[FBSSerialQueue _performNext] + 242
4   FrontBoardServices              0x24aebf60 -[FBSSerialQueue _performNextFromRunLoopSource] + 44
5   CoreFoundation                  0x2379d256 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 14
6   CoreFoundation                  0x2379ce46 __CFRunLoopDoSources0 + 454
7   CoreFoundation                  0x2379b1ae __CFRunLoopRun + 806
8   CoreFoundation                  0x236edbb8 CFRunLoopRunSpecific + 516
9   CoreFoundation                  0x236ed9ac CFRunLoopRunInMode + 108
10  UIKit                           0x279dfa16 -[UIApplication _run] + 526
11  UIKit                           0x279d9fb4 UIApplicationMain + 144
12  Where Next                      0x000a7816 main (main.m:16)
13  libdyld.dylib                   0x233a0872 start + 2

崩溃 2:

Thread 0 Crashed:
0   libobjc.A.dylib                 0x22fb3af6 objc_msgSend + 22
1   CoreUI                          0x277e3022 -[CUICatalog _resolvedRenditionKeyFromThemeRef:withBaseKey:scaleFactor:devic    eIdiom:deviceSubtype:sizeClassHorizontal:sizeClassVertical:memoryClass:graphicsClass:graphicsFallBackOrder:] + 646
2   CoreUI                          0x277e2d98 -[CUICatalog _resolvedRenditionKeyForName:scaleFactor:deviceIdiom:deviceSubt    ype:sizeClassHorizontal:sizeClassVertical:memoryClass:graphicsClass:graphicsFallBackOrder:withBaseKeySelector:] + 284
3   CoreUI                          0x277e252a -[CUICatalog     namedLookupWithName:scaleFactor:deviceIdiom:deviceSubtype:sizeClassHorizontal:sizeClassVertical:] + 94
4   UIKit                           0x28183a2c __98-[_UIAssetManager     imageNamed:scale:idiom:subtype:cachingOptions:sizeClassPair:attachCatalogImage:]_block_invoke + 496
5   UIKit                           0x2818377e -[_UIAssetManager     imageNamed:scale:idiom:subtype:cachingOptions:sizeClassPair:attachCatalogImage:] + 230
6   UIKit                           0x2798bcd4 -[_UIAssetManager imageNamed:scale:idiom:subtype:] + 108
7   UIKit                           0x2798bc62 -[_UIAssetManager imageNamed:idiom:subtype:] + 46
8   UIKit                           0x2798bc2e -[_UIAssetManager imageNamed:idiom:] + 46
9   UIKit                           0x27e1e438 -[UIImageNibPlaceholder initWithCoder:] + 456
10  UIKit                           0x27f32180 UINibDecoderDecodeObjectForValue + 780
11  UIKit                           0x27f31e68 -[UINibDecoder decodeObjectForKey:] + 296
12  UIKit                           0x27e0a602 -[UIButtonContent initWithCoder:] + 382
13  UIKit                           0x27f32180 UINibDecoderDecodeObjectForValue + 780
14  UIKit                           0x27f3250c UINibDecoderDecodeObjectForValue + 1688
15  UIKit                           0x27f31e68 -[UINibDecoder decodeObjectForKey:] + 296
16  UIKit                           0x27e0d03c -[UIButton initWithCoder:] + 748
17  UIKit                           0x27f32180 UINibDecoderDecodeObjectForValue + 780
18  UIKit                           0x27f31e68 -[UINibDecoder decodeObjectForKey:] + 296
19  UIKit                           0x27e1d202 -[UIRuntimeConnection initWithCoder:] + 114
20  UIKit                           0x27e1d88c -[UIRuntimeEventConnection initWithCoder:] + 52
21  UIKit                           0x27f32180 UINibDecoderDecodeObjectForValue + 780
22  UIKit                           0x27f32112 UINibDecoderDecodeObjectForValue + 670
23  UIKit                           0x27f31e68 -[UINibDecoder decodeObjectForKey:] + 296
24  UIKit                           0x27e1c796 -[UINib instantiateWithOwner:options:] + 1110
25  UIKit                           0x27cd6676 -[UIViewController _loadViewFromNibNamed:bundle:] + 322
26  UIKit                           0x27aab9d6 -[UIViewController loadView] + 142
27  UIKit                           0x27971a0a -[UIViewController loadViewIfRequired] + 150
28  UIKit                           0x27971958 -[UIViewController view] + 24
29  UIKit                           0x281edf4a __67-[UIStoryboardEmbedSegueTemplate     newDefaultPerformHandlerForSegue:]_block_invoke + 498
30  UIKit                           0x280642d4 -[UIStoryboardSegueTemplate _performWithDestinationViewController:sender:]     + 432
31  UIKit                           0x28064102 -[UIStoryboardSegueTemplate _perform:] + 66
32  UIKit                           0x28064374 -[UIStoryboardSegueTemplate perform:] + 132
33  UIKit                           0x27971bca -[UIViewController loadViewIfRequired] + 598
34  UIKit                           0x27971958 -[UIViewController view] + 24
35  UIKit                           0x279786d0 -[UIWindow addRootViewControllerViewIfPossible] + 68
36  UIKit                           0x27975bf2 -[UIWindow _setHidden:forced:] + 278
37  UIKit                           0x279ea914 -[UIWindow makeKeyAndVisible] + 48
38  UIKit                           0x27c0f11c -[UIApplication     _callInitializationDelegatesForMainScene:transitionContext:] + 3320
39  UIKit                           0x27c12f0e -[UIApplication _runWithMainScene:transitionContext:completion:] + 1570
40  UIKit                           0x27c26c14 __84-[UIApplication     _handleApplicationActivationWithScene:transitionContext:completion:]_block_invoke3228 + 36
41  UIKit                           0x27c103f6 -[UIApplication workspaceDidEndTransaction:] + 134
42  FrontBoardServices              0x24aebc74 -[FBSSerialQueue _performNext] + 232
43  FrontBoardServices              0x24aebf60 -[FBSSerialQueue _performNextFromRunLoopSource] + 44
44  CoreFoundation                  0x2379d256 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 14
45  CoreFoundation                  0x2379ce46 __CFRunLoopDoSources0 + 454
46  CoreFoundation                  0x2379b1ae __CFRunLoopRun + 806
47  CoreFoundation                  0x236edbb8 CFRunLoopRunSpecific + 516
48  CoreFoundation                  0x236ed9ac CFRunLoopRunInMode + 108
49  UIKit                           0x279dfa16 -[UIApplication _run] + 526
50  UIKit                           0x279d9fb4 UIApplicationMain + 144
51  Where Next                      0x000e8816 main (main.m:16)
52  libdyld.dylib                   0x233a0872 start + 2

崩溃 3:

Thread 0 Crashed:
0   libsystem_malloc.dylib          0x2349c43a tiny_free_list_remove_ptr + 126
1   libsystem_malloc.dylib          0x2349b4d0 szone_free_definite_size + 932
2   libcache.dylib                  0x2330d6f4 cache_set_name + 20
3   CoreFoundation                  0x2372eb94 -[NSCache setName:] + 136
4   CoreUI                          0x277e2f0e -[CUICatalog _resolvedRenditionKeyFromThemeRef:withBaseKey:scaleFactor:devic    eIdiom:deviceSubtype:sizeClassHorizontal:sizeClassVertical:memoryClass:graphicsClass:graphicsFallBackOrder:] + 370
5   CoreUI                          0x277e2d98 -[CUICatalog _resolvedRenditionKeyForName:scaleFactor:deviceIdiom:deviceSubt    ype:sizeClassHorizontal:sizeClassVertical:memoryClass:graphicsClass:graphicsFallBackOrder:withBaseKeySelector:] + 284
6   CoreUI                          0x277e252a -[CUICatalog     namedLookupWithName:scaleFactor:deviceIdiom:deviceSubtype:sizeClassHorizontal:sizeClassVertical:] + 94
7   UIKit                           0x28183a2c __98-[_UIAssetManager     imageNamed:scale:idiom:subtype:cachingOptions:sizeClassPair:attachCatalogImage:]_block_invoke + 496
8   UIKit                           0x2818377e -[_UIAssetManager     imageNamed:scale:idiom:subtype:cachingOptions:sizeClassPair:attachCatalogImage:] + 230
9   UIKit                           0x28183f50 -[_UIAssetManager imageNamed:withTrait:] + 408
10  UIKit                           0x27c4e94c +[UIImage imageNamed:inBundle:compatibleWithTraitCollection:] + 172
11  UIKit                           0x27aae536 +[UIImage imageNamed:] + 110
12  Where Next                      0x000e555e -[PreferenceObject resetLocations] (PreferenceObject.m:184)
13  Where Next                      0x000e4b6e __33+[PreferenceObject sharedManager]_block_invoke (PreferenceObject.m:92)
14  libdispatch.dylib               0x23377dc2 _dispatch_client_callout + 22
15  libdispatch.dylib               0x233789b2 dispatch_once_f + 62
16  Where Next                      0x000e4980 +[PreferenceObject sharedManager] (once.h:75)
17  Where Next                      0x00102440 -[AppDelegate application:didFinishLaunchingWithOptions:] (AppDelegate.m:57)
18  Where Next                      0x002ced6a VMDidFinishLaunchingWithOptions (UIApplication+VMRuntime.m:138)
19  UIKit                           0x279e664e -[UIApplication     _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 394
20  UIKit                           0x27c0f032 -[UIApplication     _callInitializationDelegatesForMainScene:transitionContext:] + 3086
21  UIKit                           0x27c12f0e -[UIApplication _runWithMainScene:transitionContext:completion:] + 1570
22  UIKit                           0x27c26c14 __84-[UIApplication     _handleApplicationActivationWithScene:transitionContext:completion:]_block_invoke3228 + 36
23  UIKit                           0x27c103f6 -[UIApplication workspaceDidEndTransaction:] + 134
24  FrontBoardServices              0x24aebc74 -[FBSSerialQueue _performNext] + 232
25  FrontBoardServices              0x24aebf60 -[FBSSerialQueue _performNextFromRunLoopSource] + 44
26  CoreFoundation                  0x2379d256 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 14
27  CoreFoundation                  0x2379ce46 __CFRunLoopDoSources0 + 454
28  CoreFoundation                  0x2379b1ae __CFRunLoopRun + 806
29  CoreFoundation                  0x236edbb8 CFRunLoopRunSpecific + 516
30  CoreFoundation                  0x236ed9ac CFRunLoopRunInMode + 108
31  UIKit                           0x279dfa16 -[UIApplication _run] + 526
32  UIKit                           0x279d9fb4 UIApplicationMain + 144
33  Where Next                      0x00103816 main (main.m:16)
34  libdyld.dylib                   0x233a0872 start + 2

最后两次崩溃看起来他们可能无法找到图像资产...但是因为我无法在调试模式或 Xcode 的任何形式的“运行”下复制它,所以我被卡住了。

感谢帮助社区!

【问题讨论】:

    标签: objective-c xcode ios9


    【解决方案1】:

    发布崩溃(通过 App Store 或 TestFlight 发送的构建发生的崩溃)可能很难确定。我有一个在NSArraycontainsObject: 函数上崩溃,我自己无法重现它,或者我是这么想的。

    我执行了以下操作来重现该错误。

    1. 转到产品 -> 方案 -> 编辑方案...
    2. 单击我的标准调试方案的“信息”选项卡
    3. 将构建配置从“调试”更改为“发布”
    4. 重建并运行项目

    在某些情况下,这不足以重现发布崩溃。我做了接下来的步骤来重现它。

    1. 取消选中方案早期信息选项卡中的“调试可执行文件”
    2. 清理了我的项目和构建文件夹(分别为 Command-Shift-K 和 Command-Alt-Shift-K)
    3. 重建并运行项目

    如果我需要做同样的事情,这就是我的配置的样子。

    一旦您能够重现崩溃(希望您可以通过日志重现),请尝试您常用的调试方法来查看崩溃的位置。执行某事时播放声音、注释行等。

    很遗憾,我不知道您的确切崩溃情况,尽管上面的这种方法帮助我重现了 90% 的用户遇到的问题,而我没有,这仅仅是因为我之前是在调试的基础上构建的。

    【讨论】:

    • 嗨,埃德温,感谢您的精彩回答!你提到的这些方法我都试过了。我也尝试提高调试的优化级别,但无济于事。最糟糕的部分是它在记录器有机会使用 TestFlight 提交崩溃之前崩溃。我会再试一次,将配置更改为发布。 T
    • 对不起,我帮不上忙 :(。这是一个艰难的过程,但我相信你会度过难关的!
    【解决方案2】:

    我的应用也出现了同样的问题。它在 iOS9 中仅通过 TestFlight 或 AppStore 发布时崩溃。
    请参阅接受的答案 https://forums.developer.apple.com/thread/60919 。它对我有用,我修复了这个错误。

    如何解决“错误 ITMS-90682: Invalid Bundle - 如果应用支持 iOS 8 或更早版本,'Payload/XXXXX/Assets.car' 的资产目录不能包含 16 位或 P3 资产。”

    对于 Xcode 8 GM,如果您在针对 iOS 9.3 之前的 iOS 版本的应用提交中包含 16 位或 P3 资产,则会出现此错误。如果您的应用需要广色域功能,您必须将部署目标更改为 iOS 9.3 或更高版本。如果您的应用不需要广色域功能并且您希望将其部署到较旧的 iOS 版本,那么您应该将所有 16 位或 P3 资源替换为 8 位 sRGB 资源。您可以通过在来自 iTunes Connect 的错误消息中命名的资产目录上运行“assetutil”来查找 16 位或 P3 资产。以下步骤概述了该过程:

    创建一个可检查的 .ipa 文件。在 Xcode Organizer(Xcode->Window->Organizer)中,选择要检查的存档,单击“Export...”,然后选择“Export for Enterprise or Ad-Hoc Deployment”。这将创建 .应用程序的 ipa 文件。 找到该 .ipa 文件并将其扩展名更改为 .zip。 展开 .zip 文件。这将生成一个包含您的 .app 包的 Payload 文件夹。 打开终端并将工作目录更改为 .app 包的顶层 cd path/to/Payload/your.app 使用查找工具在您的 .app 包中查找 Assets.car 文件,如下所示: -name 'Assets.car' 使用assetutil 工具在您的应用程序具有的每个Assets.car 中查找任何16 位或P3 资产,如下所示。 : sudo xcrun --sdk iphoneosassetutil --info /path/to/a/Assets.car > /tmp/Assets.json 检查生成的 /tmp/Assets.json 并查找包含“DisplayGamut”的任何内容:“P3”及其关联的“名称”。这将是包含一个或多个 16 位或 P3 资产的图像集的名称。 用 8 位/sRGB 资源替换这些资源,然后重新构建您的应用程序。 更新:如果您的部署目标设置为 8.3 或 8.4 并且您有一个资产目录,那么即使您实际上没有 16 位或 P3 资产,您也会收到同样的错误消息。在这种情况下,您需要将部署目标降低到 8.2,或者将其提升到 9.x。

    【讨论】:

    • 哇!传说中的答案。几个星期以来,这一直是绝对的麻烦。我会尝试您的解决方案并让您知道。谢谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-04-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-01-25
    • 1970-01-01
    相关资源
    最近更新 更多