应用程序内购买在发布后崩溃应用程序

时间:2013-09-18 05:40:27

标签: ios debugging crash in-app-purchase

Apple批准了我们的第一款具有应用内购买功能的应用 - 但是当用户点击“升级”按钮时,应用会暂时挂起然后崩溃。通过在XCode的管理器中使用控制台功能,我能够获得以下报告:

Sep 18 15:12:48 iPad MyApp[53107] <Error>: *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayI objectAtIndex:]: index 0 beyond bounds for empty array'
    *** First throw call stack:
    (0x316f92a3 0x3958497f 0x31643e8d 0x54b23 0x335ec0c5 0x335ec077 0x335ec055 0x335eb90b 0x335ebe01 0x335145f1 0x33501801 0x3350111b 0x351f35a3 0x351f31d3 0x316ce173 0x316ce117 0x316ccf99 0x3163febd 0x3163fd49 0x351f22eb 0x33555301 0x4b81f 0x399bbb20)
Sep 18 15:12:48 iPad ReportCrash[53109] <Notice>: Formulating crash report for process MyApp[53107]
Sep 18 15:12:48 iPad com.apple.launchd[1] (UIKitApplication:com.mycompany.MyApp[0x716c][53107]) <Warning>: (UIKitApplication:com.mycompany.MyApp[0x716c]) Job appears to have crashed: Abort trap: 6
Sep 18 15:12:48 iPad ReportCrash[53109] <Error>: libMobileGestalt copySystemVersionDictionaryValue: Could not lookup ReleaseType from system version dictionary
Sep 18 15:12:48 iPad backboardd[26] <Warning>: Application 'UIKitApplication:com.mycompany.MyApp[0x716c]' exited abnormally with signal 6: Abort trap: 6
Sep 18 15:12:48 iPad ReportCrash[53109] <Notice>: Saved crashreport to /var/mobile/Library/Logs/CrashReporter/MyApp_2013-09-18-151248_iPad.plist using uid: 0 gid: 0, synthetic_euid: 501 egid: 0

当我在我的设备上运行应用程序时,这不会发生,并且当Apple审核它时它一定有效,否则他们就不会将其清除出售。

我的猜测是我的产品数组为空,在尝试购买_products[0](唯一可用的产品)时,它会崩溃。

更多信息: 我在添加应用内购买时跟随Ray Wenderlich's Tutorial

[[AppStoreHelper sharedInstance] requestProductsWithCompletionHandler:^(BOOL success, NSArray *products) {
    if (success) {
        _products = products;
    }
    [refreshControl endRefreshing];
}];

总结:为什么它只能在测试模式下工作?

提前致谢!

1 个答案:

答案 0 :(得分:2)

现在有效。我猜Apple的服务器需要一些时间来处理购买......