简体   繁体   English

解决发行版本中的iOS应用崩溃

[英]Resolving iOS app crash in distribution build

I have submitted an app to the app store, and after the review, the app has been rejected. 我已将应用程序提交到应用程序商店,经过审查,该应用程序已被拒绝。 This is the explanation sent by Apple: 这是苹果公司发送的解释:

Specifically, after downloading the latest version submitted for review, Version 2.1, we found that when the user taps on the map icon, the app still crashes.

This occurred when your app was used: 

- Offline
- On Wi-Fi 
- On cellular network

I am not able to detect the issue then during development and testing the app on the emulator and on a real device, the app doesn't crash. 然后,我无法在模拟器和真实设备上开发和测试应用程序时检测到该问题,该应用程序不会崩溃。

This is the first part of the crash report: 这是崩溃报告的第一部分:

{"app_name":"mujergrancanaria","app_version":"2.0","bundleID":"com.solinpromex.casadelajuventud","adam_id":946142349,"os_version":"iPhone OS 8.1 (12B410)","slice_uuid":"601d3ebb-53d8-39ff-8766-badaadb4f776","share_with_app_devs":false,"build_version":"2.1","is_first_party":false,"bug_type":"109","name":"mujergrancanaria"}
Incident Identifier: 02C4277A-3657-4CFF-9A5D-8A3B34E1ACE4
CrashReporter Key:   34094a2f9cf3e1e29a81d365a85a102af46a1edc
Hardware Model:      xxx
Process:             mujergrancanaria [4557]
Path:                /private/var/mobile/Containers/Bundle/Application/67EFD456-E179-4049-B1A6-FBBF6D6144E4/mujergrancanaria.app/mujergrancanaria
Identifier:          com.solinpromex.casadelajuventud
Version:             2.1 (2.0)
Code Type:           ARM-64 (Native)
Parent Process:      launchd [1]

Date/Time:           2015-01-09 14:46:52.869 -0800
Launch Time:         2015-01-09 14:46:38.934 -0800
OS Version:          iOS 8.1 (12B410)
Report Version:      105

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread:  0

Last Exception Backtrace:
(0x186b85e48 0x1977d40e4 0x186b8cf14 0x186b89cc4 0x186a8ec1c 0x10025f1bc 0x10025dc38 0x10025d03c 0x10025ced4 0x1000eb240 0x18b334e84 0x18b334b94 0x18b4d7ad4 0x18b3e9310 0x18b3e90dc 0x18b3e905c 0x18b331a2c 0x18ac89994 0x18ac84564 0x18ac84408 0x18ac83c08 0x18ac8398c 0x18b333948 0x186b3e0e8 0x186b3d38c 0x186b3b43c 0x186a691f4 0x18fbe35a4 0x18b39a784 0x1000d2a40 0x197e42a08)

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libsystem_kernel.dylib          0x0000000197f5b270 __pthread_kill + 8
1   libsystem_pthread.dylib         0x0000000197ff9224 pthread_kill + 108
2   libsystem_c.dylib               0x0000000197ed2b14 abort + 108
3   libc++abi.dylib                 0x0000000196fa5414 abort_message + 112
4   libc++abi.dylib                 0x0000000196fc4b88 default_terminate_handler() + 300
5   libobjc.A.dylib                 0x00000001977d43bc _objc_terminate() + 124
6   libc++abi.dylib                 0x0000000196fc1bb0 std::__terminate(void (*)()) + 12
7   libc++abi.dylib                 0x0000000196fc1474 __cxa_throw + 132
8   libobjc.A.dylib                 0x00000001977d4200 objc_exception_throw + 344
9   CoreFoundation                  0x0000000186b8cf10 -[NSObject(NSObject) doesNotRecognizeSelector:] + 216
10  CoreFoundation                  0x0000000186b89cc0 ___forwarding___ + 924
11  CoreFoundation                  0x0000000186a8ec18 _CF_forwarding_prep_0 + 88
12  mujergrancanaria                0x000000010025f1b8 0x1000ac000 + 1782200
13  mujergrancanaria                0x000000010025dc34 0x1000ac000 + 1776692
14  mujergrancanaria                0x000000010025d038 0x1000ac000 + 1773624
15  mujergrancanaria                0x000000010025ced0 0x1000ac000 + 1773264
16  mujergrancanaria                0x00000001000eb23c 0x1000ac000 + 258620
17  UIKit                           0x000000018b334e80 -[UIViewController loadViewIfRequired] + 688
18  UIKit                           0x000000018b334b90 -[UIViewController view] + 28
19  UIKit                           0x000000018b4d7ad0 -[UINavigationController _startCustomTransition:] + 708
20  UIKit                           0x000000018b3e930c -[UINavigationController _startDeferredTransitionIfNeeded:] + 464
21  UIKit                           0x000000018b3e90d8 -[UINavigationController __viewWillLayoutSubviews] + 52
22  UIKit                           0x000000018b3e9058 -[UILayoutContainerView layoutSubviews] + 196
23  UIKit                           0x000000018b331a28 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 568
24  QuartzCore                      0x000000018ac89990 -[CALayer layoutSublayers] + 164
25  QuartzCore                      0x000000018ac84560 CA::Layer::layout_if_needed(CA::Transaction*) + 316
26  QuartzCore                      0x000000018ac84404 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 28
27  QuartzCore                      0x000000018ac83c04 CA::Context::commit_transaction(CA::Transaction*) + 272
28  QuartzCore                      0x000000018ac83988 CA::Transaction::commit() + 432
29  UIKit                           0x000000018b333944 _UIApplicationHandleEventQueue + 1696
30  CoreFoundation                  0x0000000186b3e0e4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 20
31  CoreFoundation                  0x0000000186b3d388 __CFRunLoopDoSources0 + 260
32  CoreFoundation                  0x0000000186b3b438 __CFRunLoopRun + 708
33  CoreFoundation                  0x0000000186a691f0 CFRunLoopRunSpecific + 392
34  GraphicsServices                0x000000018fbe35a0 GSEventRunModal + 164
35  UIKit                           0x000000018b39a780 UIApplicationMain + 1484
36  mujergrancanaria                0x00000001000d2a3c 0x1000ac000 + 158268
37  libdyld.dylib                   0x0000000197e42a04 start + 0

Thread 1 name:  Dispatch queue: com.apple.libdispatch-manager
Thread 1:
0   libsystem_kernel.dylib          0x0000000197f40c94 kevent64 + 8
1   libdispatch.dylib               0x0000000197e2897c _dispatch_mgr_invoke + 272
2   libdispatch.dylib               0x0000000197e1b3b0 _dispatch_mgr_thread + 48

Thread 2:
0   libsystem_kernel.dylib          0x0000000197f5bc78 __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x0000000197ff5390 _pthread_wqthread + 988
2   libsystem_pthread.dylib         0x0000000197ff4fa4 start_wqthread + 0

Thread 3:
0   libsystem_kernel.dylib          0x0000000197f5bc78 __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x0000000197ff5390 _pthread_wqthread + 988
2   libsystem_pthread.dylib         0x0000000197ff4fa4 start_wqthread + 0

Thread 4:
0   libsystem_kernel.dylib          0x0000000197f5bc78 __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x0000000197ff5390 _pthread_wqthread + 988
2   libsystem_pthread.dylib         0x0000000197ff4fa4 start_wqthread + 0

Thread 5 name:  com.apple.NSURLConnectionLoader
Thread 5:
0   libsystem_kernel.dylib          0x0000000197f40e7c mach_msg_trap + 8
1   libsystem_kernel.dylib          0x0000000197f40cf4 mach_msg + 68
2   CoreFoundation                  0x0000000186b3d5c8 __CFRunLoopServiceMachPort + 196
3   CoreFoundation                  0x0000000186b3b51c __CFRunLoopRun + 936
4   CoreFoundation                  0x0000000186a691f0 CFRunLoopRunSpecific + 392
5   CFNetwork                       0x000000018656d6a0 +[NSURLConnection(Loader) _resourceLoadLoop:] + 436
6   Foundation                      0x0000000187a55c08 __NSThread__main__ + 1068
7   libsystem_pthread.dylib         0x0000000197ff7e7c _pthread_body + 160
8   libsystem_pthread.dylib         0x0000000197ff7dd8 _pthread_start + 156
9   libsystem_pthread.dylib         0x0000000197ff4fac thread_start + 0

Thread 6:
0   libsystem_kernel.dylib          0x0000000197f5bc78 __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x0000000197ff5390 _pthread_wqthread + 988
2   libsystem_pthread.dylib         0x0000000197ff4fa4 start_wqthread + 0

Thread 7 name:  com.apple.CFSocket.private
Thread 7:
0   libsystem_kernel.dylib          0x0000000197f5b498 __select + 8
1   CoreFoundation                  0x0000000186b42fc0 __CFSocketManager + 656
2   libsystem_pthread.dylib         0x0000000197ff7e7c _pthread_body + 160
3   libsystem_pthread.dylib         0x0000000197ff7dd8 _pthread_start + 156
4   libsystem_pthread.dylib         0x0000000197ff4fac thread_start + 0

Thread 8:
0   libsystem_kernel.dylib          0x0000000197f5bc78 __workq_kernreturn + 8
1   libsystem_pthread.dylib         0x0000000197ff5390 _pthread_wqthread + 988
2   libsystem_pthread.dylib         0x0000000197ff4fa4 start_wqthread + 0

I am unable to find where to begin to find out the crash source. 我无法找到从哪里开始查找崩溃源。 Please, any clue is welcome. 请提供任何线索。

You are going to want to symbolicate your crash log. 您将要象征您的崩溃日志。 In your code this is where the crash is happening 在您的代码中,这就是崩溃发生的地方

12  mujergrancanaria                0x000000010025f1b8 0x1000ac000 + 1782200

There are a number of posts about how to symbolicate this so that you can know which file and line that crash is happening on. 关于如何用符号表示的帖子很多,这样您就可以知道发生崩溃的文件和行。 Generally all you need to do is open Xcode, then open Devices (from the menu), then select a real device, click on view device logs, and then drag your log into the list. 通常,您需要做的就是打开Xcode,然后打开“设备”(从菜单中),然后选择一个真实的设备,单击“查看设备日志”,然后将您的日志拖到列表中。 Xcode will automatically find the binary and dsym file from when you created the archive (assuming this is the same machine you build the archive on). Xcode将在创建存档时自动查找二进制文件和dsym文件(假设这是在其上构建存档的机器)。 If that doesn't work look at this Symbolicating iPhone App Crash Reports 如果这样不起作用,请查看此象征性iPhone应用程序崩溃报告

Ok so, it's map related and review team are in Palo Alto California I think (correct me if I'm wrong). 好吧,我认为这与地图相关,并且审核小组位于帕洛阿尔托(如果我错了,请纠正我)。

So I would definitly start by testing with location set in simulator in Palo Alto. 因此,我将首先从在Palo Alto的模拟器中设置的位置测试开始。

Next, the log. 接下来,是日志。

A big part is redacted 很大一部分被编辑

12  mujergrancanaria                0x000000010025f1b8 0x1000ac000 + 1782200
13  mujergrancanaria                0x000000010025dc34 0x1000ac000 + 1776692
14  mujergrancanaria                0x000000010025d038 0x1000ac000 + 1773624
15  mujergrancanaria                0x000000010025ced0 0x1000ac000 + 1773264
16  mujergrancanaria                0x00000001000eb23c 0x1000ac000 + 258620

Meaning you need to put it in Xcode or another tool where you can use the DSym (symbole file created during archiving of the app) to exploit it. 这意味着您需要将其放在Xcode或其他工具中,您可以在其中使用DSym(在应用程序归档期间创建的符号文件)来利用它。

Without it what I can tell you is that this line in the stack : 没有它,我可以告诉您的是堆栈中的这一行:

-[NSObject(NSObject) doesNotRecognizeSelector:]

Means your are calling a non existing method on an object. 表示您正在调用对象上不存在的方法。

The app crash reason was a missing flag in the Other Linker Flags section. 应用程序崩溃的原因是“其他链接器标志”部分中的标志丢失。 The app includes the Google Maps SDK for iOS, and the flag -ObjC is needed. 该应用程序包括适用于iOS的Google Maps SDK,并且需要标记-ObjC。 I had it only at the Debug Build section. 我仅在“调试构建”部分中拥有它。 Adding the flag -ObjC also in the Release Build section solves the problem, and the app doesn't crash any more when launching the Distribution file... 在“发行版本”部分中也添加标志-ObjC可以解决此问题,并且在启动分发文件时应用程序不再崩溃...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM