MKStoreKit icon indicating copy to clipboard operation
MKStoreKit copied to clipboard

App crashes only in Release configuration

Open temasnow opened this issue 9 years ago • 7 comments

Hi! App crashes only in "Release" configuration, not in "Debug". Application Specific Information: ** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** setObjectForKey: object cannot be nil (key: SKOrigBundleRef)'

Application Specific Backtrace 1: 0 CoreFoundation 0x1861c259c + 132 1 libobjc.A.dylib 0x1968c80e4 _objc_exception_throw + 60 2 CoreFoundation 0x1860ad1f8 + 972 3 schoolboy 0x10004aaa8 -[MKStoreKit startValidatingAppStoreReceiptWithCompletionHandler:] + 1616 4 CFNetwork 0x185b572d4 + 300 5 Foundation 0x18707b4a8 + 16 6 Foundation 0x186fccc34 -[NSBlockOperation main] + 96 7 Foundation 0x186fbc5bc -[__NSOperationInternal _start:] + 636 8 Foundation 0x18707e20c + 228 9 libdispatch.dylib 0x196f0d36c + 16 10 libdispatch.dylib 0x196f174c0 + 1216 11 libdispatch.dylib 0x196f10474 + 132 12 libdispatch.dylib 0x196f19224 + 664 13 libdispatch.dylib 0x196f1a75c + 108 14 libsystem_pthread.dylib 0x1970e92e4 __pthread_wqthread + 816 15 libsystem_pthread.dylib 0x1970e8fa8 _start_wqthread + 4*

Whats wrong? Thanks.

temasnow avatar Mar 03 '15 08:03 temasnow

It seems there's bug with saving "original application version", as a workaround add check if app version was returned correctly, fix MKStoreKit.m line 331 to:

NSString *originalAppVersion = jsonResponse[@"receipt"][@"original_application_version"];
      if (originalAppVersion)
          [self.purchaseRecord setObject:originalAppVersion forKey:kOriginalAppVersionKey];
      [self savePurchaseRecord];

IvanDev avatar Mar 03 '15 09:03 IvanDev

Thank you!

temasnow avatar Mar 03 '15 11:03 temasnow

Why is this closed since the workaround is not on the main code ? I have this problem too...

linked67 avatar Mar 11 '15 14:03 linked67

I deleted app from the App Store after release with the same problem.

AndreyPanov avatar Mar 15 '15 16:03 AndreyPanov

Had the same issue. Occurs on TestFlight beta (which is technically a Release version), so that may be a good way to test the fix without having to risk testing on the App Store.

mpatzer avatar Mar 16 '15 18:03 mpatzer

I have another question please help me

I am currently working with Auto-renewbalae subscription.My problem is that after completing successful purchasing i print the purchase details.but it return null.

The Purchase details is like that

Purchased/Subscribed to product with id: com.cName.aName.Auto purchaseRecord { " com.cName.aName.Auto" = "null"; }

When am trying to call expiryDateForProduct ,This will crash due to Null value

I am not calling any refreshAppStoreReceipt method from any where

Let me know why this is happening,Please help me

Thanks

Sajanrav01 avatar Mar 25 '15 08:03 Sajanrav01

Thanks for the confirmation about Testflight @michaelpatzer! A ton of my testers have been experiencing this.

I'm happy to have a fix, but bummed I couldn't catch it earlier. @MugunthKumar would you consider finding a collaborator to help catch-up on PRs if you're too busy?

warpling avatar Aug 09 '15 23:08 warpling