Tuesday, 17 September 2013

In-App Purchase crashes App after release

In-App Purchase crashes App after release

Apple has approved our first app that has In-App Purchases - however
suddenly when a user taps the "Upgrade" button the app hangs momentarily
and then crashes. By using the Console feature in XCode's Organizer I was
able to obtain the following report:
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
This does not occur when I run the app on my device, and it must've worked
when Apple review it or else they would not have cleared it for sale.
My guess it that my products array is null and when trying to purchase
item[0] (the only available one) it crashes.
To sum up: why does it only work in testing mode?
Thanks in advance!

No comments:

Post a Comment