{ "id": "176260", "key": "AC-6714", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2021-07-26T19:43:27.000+0000", "created": "2021-07-26T07:41:24.000+0000", "labels": [ "crash", "ios", "ti.identity" ], "versions": [], "issuelinks": [], "assignee": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2021-07-26T19:43:27.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": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "Hi,\r\nusing the keychainItem.fetchExistence from ti.identitymethod causes a crash on iOS but works absolutely fine on Android. This happens only if the app was uninstalled and reinstalled and the token consequently continues to exist (that happens also only on iOS, because on Android the token is deleted with the app).\r\n\r\nThanks in advance for all the help.\r\n\r\nYou can find the app source code here: https://github.com/ferdi2005/monumenti/blob/3eedf2b1b26a4f7e819acf65796832b060005b1c/app/controllers/upload/config.js\r\n\r\n*Code:*\r\n{code:java}\r\n var keychainItem = Identity.createKeychainItem({ identifier: \"token\" });\r\n\r\n keychainItem.fetchExistence({\r\n result: function(e) {\r\n if (e.exists) {\r\n keychainItem.reset();\r\n } \r\n }\r\n });\r\n{code}\r\n\r\n*Stacktrace*:\r\n{code}\r\n[DEBUG] -[__NSCFString count]: unrecognized selector sent to instance 0x7fe66189b400\r\n[DEBUG] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString count]: unrecognized selector sent to instance 0x7fe66189b400'\r\n[DEBUG] *** First throw call stack:\r\n[DEBUG] ( \r\n[DEBUG] 0 CoreFoundation 0x0000000113b7bfba __exceptionPreprocess + 242\r\n[DEBUG] 1 libobjc.A.dylib 0x00000001107f8ff5 objc_exception_throw + 48\r\n[DEBUG] 2 CoreFoundation 0x0000000113b8ad2f +[NSObject(NSObject) instanceMethodSignatureForSelector:] + 0\r\n[DEBUG] 3 CoreFoundation 0x0000000113b804cf ___forwarding___ + 1455\r\n[DEBUG] 4 CoreFoundation 0x0000000113b827a8 _CF_forwarding_prep_0 + 120\r\n[DEBUG] 5 TitaniumKit 0x00000001136b93f5 -[TiScriptError formattedNativeStack] + 133\r\n[DEBUG] 6 TitaniumKit 0x00000001136b92fb -[TiScriptError description] + 1127\r\n[DEBUG] 7 Foundation 0x00000001113aad9b _NSDescriptionWithLocaleFunc + 82\r\n[DEBUG] 8 CoreFoundation 0x0000000113b14af3 __CFStringAppendFormatCore + 12167\r\n[DEBUG] 9 CoreFoundation 0x0000000113b16589 _CFStringCreateWithFormatAndArgumentsReturningMetadata + 145\r\n[DEBUG] 10 CoreFoundation 0x0000000113b164f2 _CFStringCreateWithFormatAndArgumentsAux2 + 20\r\n[DEBUG] 11 TitaniumKit 0x000000011367b6dd TiLogMessage + 175\r\n[DEBUG] 12 TitaniumKit 0x00000001136b88b0 -[TiExceptionHandler reportScriptError:] + 74\r\n[DEBUG] 13 TitaniumKit 0x00000001136a579e TiBindingEventProcess + 731\r\n[DEBUG] 14 TitaniumKit 0x00000001136c6c23 -[KrollContext invoke:] + 109\r\n[DEBUG] 15 TitaniumKit 0x00000001136c6c96 -[KrollContext enqueue:] + 93\r\n[DEBUG] 16 TitaniumKit 0x00000001136ce06f TiBindingRunLoopEnqueue + 77\r\n[DEBUG] 17 TitaniumKit 0x00000001136cc93f -[TiProxy fireEvent:withObject:withSource:propagate:reportSuccess:errorCode:message:] + 170\r\n[DEBUG] 18 TitaniumKit 0x00000001136ad415 -[TiViewProxy fireEvent:withObject:withSource:propagate:reportSuccess:errorCode:message:] + 182\r\n[DEBUG] 19 TitaniumKit 0x000000011367f0f5 -[TiWindowProxy windowDidOpen] + 107\r\n[DEBUG] 20 WLM Italia 0x000000010cd83400 -[TiUITabProxy handleWillShowViewController:animated:] + 512\r\n[DEBUG] 21 WLM Italia 0x000000010cd830d9 -[TiUITabProxy navigationController:willShowViewController:animated:] + 457\r\n[DEBUG] 22 UIKitCore 0x00000001224c0031 -[UINavigationController _startCustomTransition:] + 1596\r\n[DEBUG] 23 UIKitCore 0x00000001224d630d -[UINavigationController _startDeferredTransitionIfNeeded:] + 705\r\n[DEBUG] 24 UIKitCore 0x00000001224d7734 -[UINavigationController __viewWillLayoutSubviews] + 150\r\n[DEBUG] 25 UIKitCore 0x00000001224b804c -[UILayoutContainerView layoutSubviews] + 217\r\n[DEBUG] 26 UIKitCore 0x0000000123233c90 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2946\r\n[DEBUG] 27 QuartzCore 0x00000001129745b8 -[CALayer layoutSublayers] + 258\r\n[DEBUG] 28 QuartzCore 0x000000011297ae3f _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 611\r\n[DEBUG] 29 QuartzCore 0x0000000112986c53 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 65\r\n[DEBUG] 30 QuartzCore 0x00000001128c0f26 _ZN2CA7Context18commit_transactionEPNS_11TransactionEdPd + 656\r\n[DEBUG] 31 QuartzCore 0x00000001128f83b9 _ZN2CA11Transaction6commitEv + 713\r\n[DEBUG] 32 QuartzCore 0x00000001128f951f _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 79\r\n[DEBUG] 33 CoreFoundation 0x0000000113ae8d31 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23\r\n[DEBUG] 34 CoreFoundation 0x0000000113ae3542 __CFRunLoopDoObservers + 541\r\n[DEBUG] 35 CoreFoundation 0x0000000113ae3af5 __CFRunLoopRun + 1129\r\n[DEBUG] 36 CoreFoundation 0x0000000113ae31a7 CFRunLoopRunSpecific + 567\r\n[DEBUG] 37 GraphicsServices 0x00000001270e5d85 GSEventRunModal + 139\r\n[DEBUG] 38 UIKitCore 0x0000000122cdc4df -[UIApplication _run] + 912\r\n[DEBUG] 39 UIKitCore 0x0000000122ce139c UIApplicationMain + 101\r\n[DEBUG] 40 WLM Italia 0x000000010cd53392 main + 1170\r\n[DEBUG] 41 libdyld.dylib 0x000000011792abbd start + 1\r\n[DEBUG] 42 ??? 0x0000000000000001 0x0 + 1\r\n[DEBUG] ) \r\n[DEBUG] libc++abi: terminating with uncaught exception of type NSException\r\n{code}\r\n", "attachment": [ { "id": "67955", "filename": "attachment.txt", "author": { "name": "ferdi.traversa", "key": "ferdi.traversa", "displayName": "Ferdinando Traversa", "active": true, "timeZone": "Europe/Rome" }, "created": "2021-07-26T07:40:58.000+0000", "size": 93475, "mimeType": "text/plain" } ], "flagged": false, "summary": "fetchExistence causes a crash on iOS but works fine on Android", "creator": { "name": "ferdi.traversa", "key": "ferdi.traversa", "displayName": "Ferdinando Traversa", "active": true, "timeZone": "Europe/Rome" }, "subtasks": [], "reporter": { "name": "ferdi.traversa", "key": "ferdi.traversa", "displayName": "Ferdinando Traversa", "active": true, "timeZone": "Europe/Rome" }, "environment": "Titanium 10.0.0.GA with the latest version of ti.identity module; iOS latest version", "comment": { "comments": [ { "id": "458906", "author": { "name": "jordanbisato", "key": "jordanbisato", "displayName": "Jórdan Luiz Bisato", "active": true, "timeZone": "America/Sao_Paulo" }, "body": "I think you can't pass a JSON to function. \r\n\r\nTry this way: \r\n{code:java}\r\nvar keychainItem = Identity.createKeychainItem({ identifier: \"token\" });\r\n \r\n keychainItem.fetchExistence(function(e) {\r\n\t\t\t\tif (e.exists) {\r\n // do what you want\r\n }\r\n\t });\r\n{code}\r\n\r\n", "updateAuthor": { "name": "jordanbisato", "key": "jordanbisato", "displayName": "Jórdan Luiz Bisato", "active": true, "timeZone": "America/Sao_Paulo" }, "created": "2021-07-26T15:25:14.000+0000", "updated": "2021-07-26T15:25:14.000+0000" }, { "id": "458908", "author": { "name": "ferdi.traversa", "key": "ferdi.traversa", "displayName": "Ferdinando Traversa", "active": true, "timeZone": "Europe/Rome" }, "body": "Ouch! Thanks Jordan, again my fault. I thought that there was a createHTTPClient-like behaviour.", "updateAuthor": { "name": "ferdi.traversa", "key": "ferdi.traversa", "displayName": "Ferdinando Traversa", "active": true, "timeZone": "Europe/Rome" }, "created": "2021-07-26T17:57:07.000+0000", "updated": "2021-07-26T17:57:07.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }