{ "id": "171143", "key": "MOD-2399", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10034", "key": "MOD", "name": "Appcelerator Modules", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "20139", "name": "Ti.StoreKit 4.3.2", "archived": false, "released": false } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-06-20T08:32:08.000+0000", "created": "2018-02-20T15:05:18.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "crash", "production", "storekit" ], "versions": [ { "id": "20072", "name": "Ti.StoreKit 4.3.0", "archived": false, "released": true } ], "issuelinks": [], "assignee": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2018-08-06T17:49:31.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10089", "name": "StoreKit" } ], "description": "What about I'm writing it's a very strange thing. I released an update of my app with in app purchase . \r\nOne user with iPhone X reported me that trying to +restore+ in app purchases the app goes in crash. \r\nI tried with my iPhone 6s and other 6s and 5c without problems. \r\nWhen my brother tried on its iPhone 5s the app is crashed. He has tried with wife's iPhone 5s... same crash. Finally I tried with my father's iPhone 5s.... the same thing... app is crashed. I tried to run app in development mode on the iPhone 5s to see the debug and understand the problem. App doesn't crash but get error:\r\n\r\n[ERROR] : Failed to restore all completed transactions: Error Domain=SKErrorDomain Code=0 \"Impossibile connettersi a iTunes Store\" UserInfo={NSLocalizedDescription=Impossibile connettersi a iTunes Store}\r\n\r\nHow can I debug this problem? Any ideas? It's first time that I have a no replicable production problem.\r\n\r\n", "attachment": [], "flagged": false, "summary": "Ti.StoreKit: App crash during restore in app purchases", "creator": { "name": "otto.pic", "key": "otto.pic", "displayName": "Lorenzo Piccinini", "active": true, "timeZone": "Europe/Rome" }, "subtasks": [], "reporter": { "name": "otto.pic", "key": "otto.pic", "displayName": "Lorenzo Piccinini", "active": true, "timeZone": "Europe/Rome" }, "environment": null, "closedSprints": [ { "id": 1045, "state": "closed", "name": "2018 Sprint 13 SDK", "startDate": "2018-06-17T20:47:13.621Z", "endDate": "2018-07-01T20:47:00.000Z", "completeDate": "2018-07-02T18:40:05.029Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "434717", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hey there! That error sounds like an iTunes server issue. There are some native threads about this issue as well, so you might want to contact Apple to check the status. If it still persists now, please let us know and provide a test case, we will validate it then. Thanks!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-02-21T19:31:49.000+0000", "updated": "2018-02-21T19:31:49.000+0000" }, { "id": "434727", "author": { "name": "otto.pic", "key": "otto.pic", "displayName": "Lorenzo Piccinini", "active": true, "timeZone": "Europe/Rome" }, "body": "Hello, the error I think is not the real cause, with the sandbox is very frequent and in that case app isn’ crashed.\nThe real problem is the app crashed by storekit in production (testflight too) ever with iPhone 5s and iPhone X . I’m not able to reproduce it with iPhone 5c and iPhone 6s in production and development too. \nI’m in difficulty to debug it. Can I debug production app?", "updateAuthor": { "name": "otto.pic", "key": "otto.pic", "displayName": "Lorenzo Piccinini", "active": true, "timeZone": "Europe/Rome" }, "created": "2018-02-21T20:33:14.000+0000", "updated": "2018-02-21T20:33:14.000+0000" }, { "id": "434729", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "There must be something wrong with your configuration. The functionality is used in many production apps without issues. You can see the symbolicated crash log in iTunes connect if you checked that option (include dSYM) during app upload. If you have that, you can upload it here and we can take a look again. For now, we need a test case in order to reproduce it.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-02-21T20:56:36.000+0000", "updated": "2018-02-21T20:56:36.000+0000" }, { "id": "434735", "author": { "name": "otto.pic", "key": "otto.pic", "displayName": "Lorenzo Piccinini", "active": true, "timeZone": "Europe/Rome" }, "body": "Ok, I found the log. In Xcode red line on point 5.\r\n\r\nLast Exception Backtrace:\r\n0 CoreFoundation \t0x18179f164 __exceptionPreprocess + 124 (NSException.m:166)\r\n1 libobjc.A.dylib \t0x1809e8528 objc_exception_throw + 56 (objc-exception.mm:521)\r\n2 CoreFoundation \t0x181737c9c _CFThrowFormattedException + 112 (CFObject.m:1937)\r\n3 CoreFoundation \t0x18166ffd0 -[__NSPlaceholderDictionary initWithObjects:forKeys:count:] + 352 (NSPlaceholderDictionary.m:0)\r\n4 CoreFoundation \t0x18166fe4c +[NSDictionary dictionaryWithObjects:forKeys:count:] + 64 (NSDictionary.m:622)\r\n5 \"NAME APP\" \t0x1008c51c4 -[TiStorekitModule paymentQueueRestoreCompletedTransactionsFinished:] + 120 (TiStoreKitModule.m:582)\r\n6 CoreFoundation \t0x1816645a0 CFArrayApplyFunction + 80 (CFArray.c:684)\r\n7 StoreKit \t0x194cfea38 -[SKPaymentQueue _notifyObserversRestoreTransactionsFinished] + 136 (SKPaymentQueue.m:567)\r\n8 StoreKit \t0x194cfe328 __44-[SKPaymentQueue _handleMessage:connection:]_block_invoke + 168 (SKPaymentQueue.m:0)\r\n9 libdispatch.dylib \t0x18111ea54 _dispatch_call_block_and_release + 24 (init.c:994)\r\n10 libdispatch.dylib \t0x18111ea14 _dispatch_client_callout + 16 (object.m:502)\r\n11 libdispatch.dylib \t0x18112b698 _dispatch_main_queue_callback_4CF$VARIANT$mp + 1016 (inline_internal.h:2500)\r\n12 CoreFoundation \t0x181747344 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12 (CFRunLoop.c:1815)\r\n13 CoreFoundation \t0x181744f20 __CFRunLoopRun + 2012 (CFRunLoop.c:3111)\r\n14 CoreFoundation \t0x181664c58 CFRunLoopRunSpecific + 436 (CFRunLoop.c:3245)\r\n15 GraphicsServices \t0x183510f84 GSEventRunModal + 100 (GSEvent.c:2245)\r\n16 UIKit \t0x18adbd5c4 UIApplicationMain + 236 (UIApplication.m:3956)\r\n17 \"NAME APP\" \t0x100635114 main + 84 (main.m:30)\r\n18 libdyld.dylib \t0x18118456c start + 4", "updateAuthor": { "name": "otto.pic", "key": "otto.pic", "displayName": "Lorenzo Piccinini", "active": true, "timeZone": "Europe/Rome" }, "created": "2018-02-21T21:33:56.000+0000", "updated": "2018-02-21T21:43:07.000+0000" }, { "id": "434742", "author": { "name": "otto.pic", "key": "otto.pic", "displayName": "Lorenzo Piccinini", "active": true, "timeZone": "Europe/Rome" }, "body": "Hey there! I have important news: I done rollback to ti.storekit 4.1.1 and its seems there are no more crashes during in app purchases restoring!", "updateAuthor": { "name": "otto.pic", "key": "otto.pic", "displayName": "Lorenzo Piccinini", "active": true, "timeZone": "Europe/Rome" }, "created": "2018-02-21T23:09:13.000+0000", "updated": "2018-02-21T23:42:04.000+0000" }, { "id": "434905", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hey [~otto.pic], good catch! Although I am happy it works, of course it should work for all future versions as well. Would you mind trying [this binary|https://www.dropbox.com/s/2z223h95g5yishe/ti.storekit-iphone-4.3.1.zip?dl=0] (v4.3.1) which addresses a few possible issues regarding null-values. If it works, we will release a new version immediately. Thanks for testing!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-02-26T13:56:31.000+0000", "updated": "2018-02-26T13:56:31.000+0000" }, { "id": "434908", "author": { "name": "otto.pic", "key": "otto.pic", "displayName": "Lorenzo Piccinini", "active": true, "timeZone": "Europe/Rome" }, "body": "Thank you Hans !! I downloaded it and I will do tests asap. I'll update you about results.", "updateAuthor": { "name": "otto.pic", "key": "otto.pic", "displayName": "Lorenzo Piccinini", "active": true, "timeZone": "Europe/Rome" }, "created": "2018-02-26T14:13:23.000+0000", "updated": "2018-02-26T14:13:48.000+0000" }, { "id": "434909", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Btw, there is also a new [iOS 11.3 API|https://developer.apple.com/documentation/storekit/skadnetwork/2943654-registerappforadnetworkattributi?language=objc] we could include. So if it works, we can include that one as well!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-02-26T14:19:58.000+0000", "updated": "2018-02-26T14:19:58.000+0000" }, { "id": "434920", "author": { "name": "otto.pic", "key": "otto.pic", "displayName": "Lorenzo Piccinini", "active": true, "timeZone": "Europe/Rome" }, "body": "I tested new lib distributing the app by testflight, unfortunately app crash again during restore. ", "updateAuthor": { "name": "otto.pic", "key": "otto.pic", "displayName": "Lorenzo Piccinini", "active": true, "timeZone": "Europe/Rome" }, "created": "2018-02-26T17:24:50.000+0000", "updated": "2018-02-26T17:24:50.000+0000" }, { "id": "435050", "author": { "name": "otto.pic", "key": "otto.pic", "displayName": "Lorenzo Piccinini", "active": true, "timeZone": "Europe/Rome" }, "body": "Good morning @Hans,\r\nhave you seen my last reply about test of Ti.StoreKit 4.3.1 ?", "updateAuthor": { "name": "otto.pic", "key": "otto.pic", "displayName": "Lorenzo Piccinini", "active": true, "timeZone": "Europe/Rome" }, "created": "2018-03-01T09:16:06.000+0000", "updated": "2018-03-01T09:16:06.000+0000" }, { "id": "436018", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hey there! Jumping back on this one now. Can you get a crash log? The (localized) error is not the best for debugging in this case. Also, does the crash happen when calling {{restoreCompletedTransactions}} or a different method? And does it crash when calling it or when the purchase restore is performed internally (a few seconds later)?", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-03-28T09:57:01.000+0000", "updated": "2018-03-28T10:16:55.000+0000" }, { "id": "436020", "author": { "name": "otto.pic", "key": "otto.pic", "displayName": "Lorenzo Piccinini", "active": true, "timeZone": "Europe/Rome" }, "body": "App crash like first time have reported during restoring. \r\n\r\nFrom crashlog report:\r\n\r\n5 NAME APP \t0x1011491a4 -[TiStorekitModule paymentQueueRestoreCompletedTransactionsFinished:] + 2707876 (TiStoreKitModule.m:582)\r\n\r\nI'm not able to test on my device, from log I'm not understand if crash during call or not, but if I remember well, products wasn't restored after relaunch of the app.\r\n", "updateAuthor": { "name": "otto.pic", "key": "otto.pic", "displayName": "Lorenzo Piccinini", "active": true, "timeZone": "Europe/Rome" }, "created": "2018-03-28T10:26:40.000+0000", "updated": "2018-03-28T10:26:40.000+0000" }, { "id": "436021", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "I think I finally found the issue. It was a one-liner typo during the refactoring of the module. Please try [this module|https://www.dropbox.com/s/9nj3hpzcy2xxxik/ti.storekit-iphone-4.3.2.zip?dl=0] and remember to set the {{version=\"4.3.2\"}} attribute in the {{}}, so it actually uses the version.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-03-28T10:38:38.000+0000", "updated": "2018-03-28T10:38:38.000+0000" }, { "id": "436024", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR: https://github.com/appcelerator-modules/ti.storekit/pull/34", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-03-28T11:56:42.000+0000", "updated": "2018-03-28T11:56:42.000+0000" }, { "id": "436078", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~otto.pic] Can you please try it out?", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-03-29T14:09:11.000+0000", "updated": "2018-03-29T14:09:11.000+0000" }, { "id": "436091", "author": { "name": "otto.pic", "key": "otto.pic", "displayName": "Lorenzo Piccinini", "active": true, "timeZone": "Europe/Rome" }, "body": "I tried it, I'm sorry but it crash again. Xcode crash report show me the same error.\r\nI'm sorry if I'm not enough helpful.\r\n\r\nLast Exception Backtrace:\r\n0 CoreFoundation \t0x18690f164 __exceptionPreprocess + 124 (NSException.m:166)\r\n1 libobjc.A.dylib \t0x185b58528 objc_exception_throw + 56 (objc-exception.mm:521)\r\n2 CoreFoundation \t0x1868a7c9c _CFThrowFormattedException + 112 (CFObject.m:1937)\r\n3 CoreFoundation \t0x1867dffd0 -[__NSPlaceholderDictionary initWithObjects:forKeys:count:] + 352 (NSPlaceholderDictionary.m:0)\r\n4 CoreFoundation \t0x1867dfe4c +[NSDictionary dictionaryWithObjects:forKeys:count:] + 64 (NSDictionary.m:622)\r\n5 [APP NAME] \t0x1005c4d14 -[TiStorekitModule paymentQueueRestoreCompletedTransactionsFinished:] + 120 (TiStoreKitModule.m:582)\r\n6 CoreFoundation \t0x1867d45a0 CFArrayApplyFunction + 80 (CFArray.c:684)\r\n7 StoreKit \t0x199e6ea38 -[SKPaymentQueue _notifyObserversRestoreTransactionsFinished] + 136 (SKPaymentQueue.m:567)\r\n8 StoreKit \t0x199e6e328 __44-[SKPaymentQueue _handleMessage:connection:]_block_invoke + 168 (SKPaymentQueue.m:0)\r\n9 libdispatch.dylib \t0x18628ea54 _dispatch_call_block_and_release + 24 (init.c:994)\r\n10 libdispatch.dylib \t0x18628ea14 _dispatch_client_callout + 16 (object.m:502)\r\n11 libdispatch.dylib \t0x18629b698 _dispatch_main_queue_callback_4CF$VARIANT$mp + 1016 (inline_internal.h:2500)\r\n12 CoreFoundation \t0x1868b7344 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12 (CFRunLoop.c:1815)\r\n13 CoreFoundation \t0x1868b4f20 __CFRunLoopRun + 2012 (CFRunLoop.c:3111)\r\n14 CoreFoundation \t0x1867d4c58 CFRunLoopRunSpecific + 436 (CFRunLoop.c:3245)\r\n15 GraphicsServices \t0x188680f84 GSEventRunModal + 100 (GSEvent.c:2245)\r\n16 UIKit \t0x18ff2d5c4 UIApplicationMain + 236 (UIApplication.m:3956)\r\n17 [APP NAME] \t0x1003358fc main + 84 (main.m:30)\r\n18 libdyld.dylib \t0x1862f456c start + 4", "updateAuthor": { "name": "otto.pic", "key": "otto.pic", "displayName": "Lorenzo Piccinini", "active": true, "timeZone": "Europe/Rome" }, "created": "2018-03-29T15:16:10.000+0000", "updated": "2018-03-29T15:21:55.000+0000" }, { "id": "436123", "author": { "name": "richard@gorbutt.com", "key": "richard@gorbutt.com", "displayName": "richard@gorbutt.com", "active": true, "timeZone": "America/New_York" }, "body": "4.3.2 is behaving on my iPhone 7+ iOS 11.3.2 with this build. However I think because I already have the receipt from a test purchase using 4.1.1 it may be OK. To test that I re-ran the app with 4.3.0 and it worked the same. Not sure I can get rid of the receipt. So, for me, it's not conclusive. ", "updateAuthor": { "name": "richard@gorbutt.com", "key": "richard@gorbutt.com", "displayName": "richard@gorbutt.com", "active": true, "timeZone": "America/New_York" }, "created": "2018-03-30T00:45:46.000+0000", "updated": "2018-03-30T00:45:46.000+0000" }, { "id": "436126", "author": { "name": "otto.pic", "key": "otto.pic", "displayName": "Lorenzo Piccinini", "active": true, "timeZone": "Europe/Rome" }, "body": "How reported in the first comment on every iPhone 5s app crash 100% with or without receipt of previous storekit version.. With other devices is different.On my iPhone 6s doesn’t crash, but on iPhone 6s of my friend is crashed and production user reported me the same thing with a iPhone X. Rolling back to 4.1.1 no more issues from any devices. It seems a memory problem or something like this. If you have a iphone 5S too I can send you invitation to test my app.", "updateAuthor": { "name": "otto.pic", "key": "otto.pic", "displayName": "Lorenzo Piccinini", "active": true, "timeZone": "Europe/Rome" }, "created": "2018-03-30T06:23:52.000+0000", "updated": "2018-03-30T06:23:52.000+0000" }, { "id": "438539", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "I *finally* figured out the real error. It was the shorthand {{NSDictionary}} usage:\r\n{code:objc}\r\n// CRASH!\r\nNSDictionary *event = @{ @\"transactions\" : _restoredTransactions };\r\n\r\n// NO CRASH\r\nNSDictionary *event = [NSDictionary dictionaryWithObjectsAndKeys:_restoredTransactions, @\"transactions\", nil];\r\n{code}\r\n\r\nI fixed it by guarding the {{_restoredTransactions}} against {{nil}} and it works just fine again. \r\n\r\nNew release: https://github.com/appcelerator-modules/ti.storekit/releases/tag/v4.3.2", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-06-20T08:32:08.000+0000", "updated": "2018-06-20T08:32:08.000+0000" }, { "id": "438540", "author": { "name": "otto.pic", "key": "otto.pic", "displayName": "Lorenzo Piccinini", "active": true, "timeZone": "Europe/Rome" }, "body": "Great work! I'll test it again. Thank you so much!", "updateAuthor": { "name": "otto.pic", "key": "otto.pic", "displayName": "Lorenzo Piccinini", "active": true, "timeZone": "Europe/Rome" }, "created": "2018-06-20T08:35:14.000+0000", "updated": "2018-06-20T08:35:14.000+0000" }, { "id": "438672", "author": { "name": "otto.pic", "key": "otto.pic", "displayName": "Lorenzo Piccinini", "active": true, "timeZone": "Europe/Rome" }, "body": "It seems it's works fine.", "updateAuthor": { "name": "otto.pic", "key": "otto.pic", "displayName": "Lorenzo Piccinini", "active": true, "timeZone": "Europe/Rome" }, "created": "2018-06-25T15:29:53.000+0000", "updated": "2018-06-25T15:29:53.000+0000" }, { "id": "440206", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Cleaning up older fixed issues. If this issue should not have been closed as fixed, please reopen.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-08-06T17:49:31.000+0000", "updated": "2018-08-06T17:49:31.000+0000" } ], "maxResults": 23, "total": 23, "startAt": 0 } } }