iOS应用程序的崩溃报告

iOS应用程序的崩溃报告,ios,crash,in-app-purchase,mkstorekit,Ios,Crash,In App Purchase,Mkstorekit,我的应用程序中的应用内购买部分有问题。问题只出现在iPhone6、6s和iPadAir上。点击任何应用内购买时,应用程序正在崩溃 以下是坠机报告: *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 18446744073709551615 beyond bounds for empty array' *** First

我的应用程序中的应用内购买部分有问题。问题只出现在iPhone6、6s和iPadAir上。点击任何应用内购买时,应用程序正在崩溃

以下是坠机报告:

*** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 18446744073709551615 beyond bounds for empty array'
*** First throw call stack:
(
    0   CoreFoundation                      0x000000010b86ef65 __exceptionPreprocess + 165
    1   libobjc.A.dylib                     0x000000010b241deb objc_exception_throw + 48
    2   CoreFoundation                      0x000000010b752a94 -[__NSArrayM objectAtIndex:] + 212
    3   Chubby Vikings Free                 0x0000000106654366 -[MKStoreManager addToQueue:] + 294
    4   Chubby Vikings Free                 0x0000000106653fde __52-[MKStoreManager buyFeature:onComplete:onCancelled:]_block_invoke + 526
    5   Chubby Vikings Free                 0x00000001065ac2ae +[MKSKProduct verifyProductForReviewAccess:onComplete:onError:] + 174
    6   Chubby Vikings Free                 0x0000000106653d46 -[MKStoreManager buyFeature:onComplete:onCancelled:] + 502
    7   Chubby Vikings Free                 0x00000001065d5a79 -[DBPurchaseManager makePurchase:onComplete:onCancel:] + 313
    8   Chubby Vikings Free                 0x00000001065e1fd1 -[vShopCoinsPopup clickCoinsPack1:] + 225
    9   CoreFoundation                      0x000000010b75d85c __invoking___ + 140
    10  CoreFoundation                      0x000000010b75d6ae -[NSInvocation invoke] + 286
    11  Chubby Vikings Free                 0x00000001066a0773 -[CCMenuItem activate] + 67
    12  Chubby Vikings Free                 0x000000010669d80e -[CCMenu ccTouchEnded:withEvent:] + 286
    13  Chubby Vikings Free                 0x00000001066edfae -[CCTouchDispatcher touches:withEvent:withTouchType:] + 1598
    14  Chubby Vikings Free                 0x00000001066eea3e -[CCTouchDispatcher touchesEnded:withEvent:] + 78
    15  Chubby Vikings Free                 0x0000000106670a64 -[CCTouchView touchesEnded:withEvent:] + 84
    16  UIKit                               0x0000000108b67aa3 -[UIWindow _sendTouchesForEvent:] + 835
    17  UIKit                               0x0000000108b68691 -[UIWindow sendEvent:] + 865
    18  UIKit                               0x0000000108b1a752 -[UIApplication sendEvent:] + 263
    19  UIKit                               0x0000000108af5fcc _UIApplicationHandleEventQueue + 6693
    20  CoreFoundation                      0x000000010b79b0a1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
    21  CoreFoundation                      0x000000010b790fcc __CFRunLoopDoSources0 + 556
    22  CoreFoundation                      0x000000010b790483 __CFRunLoopRun + 867
    23  CoreFoundation                      0x000000010b78fe98 CFRunLoopRunSpecific + 488
    24  GraphicsServices                    0x000000010dabbad2 GSEventRunModal + 161
    25  UIKit                               0x0000000108afb676 UIApplicationMain + 171
    26  Chubby Vikings Free                 0x00000001065977c4 main + 100
    27  libdyld.dylib                       0x000000010bd5292d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

数组的大小为零。因此,您尝试调用
[array objectAtIndex:0]
。0超出了空数组的边界(毫不奇怪,任何内容都超出了空数组的边界)。

检查产品列表数组,它将返回空列表显示
[vshopconspopup clickCoinsPack1:
@NANNAV谢谢。你能给我更多的帮助吗。我不知道如何检查产品列表数组。thanks@ThomasVarberg将代码添加到引用中,否则请检查数组计数是否不等于零。但我不明白为什么应用程序会崩溃,因为它只会在使用iPhone6和iPadAir的模拟器时发生。在iPhone5上,一切都很完美。当将原始捆绑包ID更改为刚创建的新捆绑包ID时,也会发生这种情况。提前感谢。您是否在“应用程序ID”中启用应用程序内购买?还验证了您在配置配置文件中选择的“应用程序ID”@Thomas请检查您的真实设备。因为有时应用程序内购买在模拟器中不起作用。显示此链接:感谢您的回答。是,已启用应用内购买,并已创建资源调配。当在我的iPad上运行时,我没有问题,但苹果会因为崩溃而拒绝。转到“窗口->管理器”,选择崩溃的版本,然后单击“在项目中打开”。