iOS In App Purchase 仅在 App 审核中崩溃 - 在沙盒测试中找到作品

iOS In App Purchase crashed only in App review - works find in sandbox testing

我有一个新的应用程序被拒绝了两次,并具有相同的崩溃日志。他们说当他们点击“购买”按钮进行应用程序内购买时它崩溃了,并给了我崩溃文件。我已经符号化了,对我帮助不大,有不妥的可以让大佬看看指点一下吗?

IAP 已在 2 个沙箱用户的沙箱中成功测试。我还确保我的 IAP 实际上是 "Cleared for sale" 从我这边也是 "Submitted for review"。我的银行账户信息也是最新的,合同已获批准。

这是符号化的日志:

{"app_name":"APPNAME","timestamp":"2017-12-18 08:48:19.56 -0800","app_version":"1.0","slice_uuid":"915a18a0-7c26-3ffd-af45-102cc6d53e21","adam_id":1326580740,"build_version":"2","bundleID":"com.MYCOMPANY.APPNAME","share_with_app_devs":false,"is_first_party":false,"bug_type":"109","os_version":"iPhone OS 11.2.1 (15C153)","incident_id":"43C16882-BFF8-4C5E-80D7-01AEEE78F017","name":"APPNAME"}
Incident Identifier: 43C16882-BFF8-4C5E-80D7-01AEEE78F017
CrashReporter Key:   6079b68e9b231d52a24bc0ce1c55aa975b16774c
Hardware Model:      xxx
Process:             APPNAME [1217]
Path:                /private/var/containers/Bundle/Application/81E108AB-4E43-4034-9A37-6C83929E75D4/APPNAME.app/APPNAME
Identifier:          com.MYCOMPANY.APPNAME
Version:             2 (1.0)
Code Type:           ARM-64 (Native)
Role:                Foreground
Parent Process:      launchd [1]
Coalition:           com.MYCOMPANY.APPNAME [832]


Date/Time:           2017-12-18 08:48:19.4110 -0800
Launch Time:         2017-12-18 08:43:02.9432 -0800
OS Version:          iPhone OS 11.2.1 (15C153)
Baseband Version:    6.30.04
Report Version:      104

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

Application Specific Information:
abort() called

Filtered syslog:
None found

Last Exception Backtrace:
0   CoreFoundation                  0x18411e364 __exceptionPreprocess + 124
1   libobjc.A.dylib                 0x183364528 objc_exception_throw + 55
2   CoreFoundation                  0x18411e2ac +[NSException raise:format:] + 115
3   StoreKit                        0x19758aa98 -[SKPaymentQueue addPayment:] + 539
4   APPNAME                     0x1007a362c 0x100798000 + 46636
5   UIKit                           0x18d6346b4 -[UIApplication sendAction:to:from:forEvent:] + 95
6   UIKit                           0x18d634634 -[UIControl sendAction:to:forEvent:] + 79
7   UIKit                           0x18d61f1dc -[UIControl _sendActionsForEvents:withEvent:] + 439
8   UIKit                           0x18d633f28 -[UIControl touchesEnded:withEvent:] + 575
9   UIKit                           0x18d633a48 -[UIWindow _sendTouchesForEvent:] + 2543
10  UIKit                           0x18d62ef60 -[UIWindow sendEvent:] + 3207
11  UIKit                           0x18d5fff64 -[UIApplication sendEvent:] + 339
12  UIKit                           0x18df5531c __dispatchPreprocessedEventFromEventQueue + 2363
13  UIKit                           0x18df578a8 __handleEventQueueInternal + 4759
14  UIKit                           0x18df507c0 __handleHIDEventFetcherDrain + 151
15  CoreFoundation                  0x1840c697c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 23
16  CoreFoundation                  0x1840c68fc __CFRunLoopDoSource0 + 87
17  CoreFoundation                  0x1840c6184 __CFRunLoopDoSources0 + 203
18  CoreFoundation                  0x1840c3d5c __CFRunLoopRun + 1047
19  CoreFoundation                  0x183fe3e58 CFRunLoopRunSpecific + 435
20  GraphicsServices                0x185e90f84 GSEventRunModal + 99
21  UIKit                           0x18d66367c UIApplicationMain + 235
22  APPNAME                     0x1007aab60 0x100798000 + 76640
23  libdyld.dylib                   0x183b0056c start + 3


Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   libsystem_kernel.dylib          0x0000000183c302e8 __pthread_kill + 8
1   libsystem_pthread.dylib         0x0000000183d452f8 pthread_kill$VARIANT$mp + 396
2   libsystem_c.dylib               0x0000000183b9efbc abort + 140
3   libc++abi.dylib                 0x000000018333b068 __cxa_bad_cast + 0
4   libc++abi.dylib                 0x000000018333b210 default_unexpected_handler+ 8720 () + 0
5   libobjc.A.dylib                 0x0000000183364810 _objc_terminate+ 34832 () + 124
6   libc++abi.dylib                 0x000000018335354c std::__terminate(void (*)+ 107852 ()) + 16
7   libc++abi.dylib                 0x0000000183353158 __cxa_rethrow + 144
8   libobjc.A.dylib                 0x00000001833646e8 objc_exception_rethrow + 44
9   CoreFoundation                  0x0000000183fe3ec4 CFRunLoopRunSpecific + 544
10  GraphicsServices                0x0000000185e90f84 GSEventRunModal + 100
11  UIKit                           0x000000018d66367c UIApplicationMain + 236
12  APPNAME                     0x00000001007aab60 0x100798000 + 76640
13  libdyld.dylib                   0x0000000183b0056c start + 4

Thread 1 name:  com.apple.uikit.eventfetch-thread
Thread 1:
0   libsystem_kernel.dylib          0x0000000183c0f568 mach_msg_trap + 8
1   libsystem_kernel.dylib          0x0000000183c0f3e0 mach_msg + 72
2   CoreFoundation                  0x00000001840c6308 __CFRunLoopServiceMachPort + 196
3   CoreFoundation                  0x00000001840c3ed4 __CFRunLoopRun + 1424
4   CoreFoundation                  0x0000000183fe3e58 CFRunLoopRunSpecific + 436
5   Foundation                      0x0000000184a19594 -[NSRunLoop+ 50580 (NSRunLoop) runMode:beforeDate:] + 304
6   Foundation                      0x0000000184a389ac -[NSRunLoop+ 178604 (NSRunLoop) runUntilDate:] + 96
7   UIKit                           0x000000018e1cd7b8 -[UIEventFetcher threadMain] + 136
8   Foundation                      0x0000000184b1b0f4 __NSThread__start__ + 996
9   libsystem_pthread.dylib         0x0000000183d442b4 _pthread_body + 308
10  libsystem_pthread.dylib         0x0000000183d44180 _pthread_body + 0
11  libsystem_pthread.dylib         0x0000000183d42b74 thread_start + 4

Thread 2 name:  com.apple.NSURLConnectionLoader
Thread 2:
0   libsystem_kernel.dylib          0x0000000183c0f568 mach_msg_trap + 8
1   libsystem_kernel.dylib          0x0000000183c0f3e0 mach_msg + 72
2   CoreFoundation                  0x00000001840c6308 __CFRunLoopServiceMachPort + 196
3   CoreFoundation                  0x00000001840c3ed4 __CFRunLoopRun + 1424
4   CoreFoundation                  0x0000000183fe3e58 CFRunLoopRunSpecific + 436
5   CFNetwork                       0x00000001848d3128 -[__CoreSchedulingSetRunnable runForever] + 780
6   Foundation                      0x0000000184b1b0f4 __NSThread__start__ + 996
7   libsystem_pthread.dylib         0x0000000183d442b4 _pthread_body + 308
8   libsystem_pthread.dylib         0x0000000183d44180 _pthread_body + 0
9   libsystem_pthread.dylib         0x0000000183d42b74 thread_start + 4

Thread 3:
0   libsystem_pthread.dylib         0x0000000183d42b68 start_wqthread + 0

Thread 4:
0   libsystem_pthread.dylib         0x0000000183d42b68 start_wqthread + 0

Thread 5:
0   libsystem_pthread.dylib         0x0000000183d42b68 start_wqthread + 0

Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x0000000000000000   x1: 0x0000000000000000   x2: 0x0000000000000000   x3: 0x00000001c40f9937
    x4: 0x0000000183358afd   x5: 0x000000016f6674d0   x6: 0x000000000000006e   x7: 0xffffffffffffffec
    x8: 0x0000000008000000   x9: 0x0000000004000000  x10: 0x0000000183d495e0  x11: 0x0000000000000003
   x12: 0xffffffffffffffff  x13: 0x0000000000000001  x14: 0x0000000183bb553f  x15: 0x0000000000000010
   x16: 0x0000000000000148  x17: 0x00000000ffffffff  x18: 0xfffffff00e09925c  x19: 0x0000000000000006
   x20: 0x00000001b4e6fb80  x21: 0x000000016f6674d0  x22: 0x0000000000000303  x23: 0x00000001b4e6fc60
   x24: 0x00000001c0005270  x25: 0x0000000000000000  x26: 0x0000000000000001  x27: 0x0000000000000000
   x28: 0x000000016f667b30   fp: 0x000000016f667430   lr: 0x0000000183d452f8
    sp: 0x000000016f667400   pc: 0x0000000183c302e8 cpsr: 0x00000000

我解决了这个问题。

In Xcode > Target > Capabilities > 确保在此处打开应用内购买。如果您不这样做,那么在使用 Sandbox 进行测试时,应用内购买就可以正常工作。但是,当应用审查将测试或应用上线时,点击“购买”按钮将导致应用崩溃,因为出于某种原因,产品不会加载。崩溃日志不会有多大用处,因为它只会显示 StoreKit 崩溃,但不会提及任何有关功能的信息。 IAP 需要在功能中启用 IAP 才能在实时应用程序中工作。我不知道为什么沙盒测试和 App review/Live app.

之间存在这种不一致

同样在代码中,如果产品不是 nil,则只执行 addPayment。由于我的功能未启用,因此未加载产品。所以当我调用 addPayment 时,它崩溃了:

[SKPaymentQueue addPayment:]

同样在 iTunes 连接中,在银行信息中,确保 "Account holder type" 字段已设置。不确定这是否是一个新领域,但我还没有确定,我已经成功提交 IAP 5 年了。只是这次说没有设置holder type

现在应用审核团队还没有报告 IAP 崩溃。