{ "id": "128137", "key": "TIMOB-17289", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": null, "resolutiondate": null, "created": "2014-03-25T20:27:19.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [], "versions": [], "issuelinks": [], "assignee": null, "updated": "2018-02-28T20:03:55.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "h4. Problem Description\r\n\r\nSmart Banner successfully launches an app. But as soon as we try to use \"app-argument\" parameter to pass anything (even with a custom scheme url that app supports) app will crash right after the launch/resume due to uncaught exception:\r\n\r\n\r\n: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** setObjectForKey: object cannot be nil (key: source)'\r\n\r\nSmart Banners doc: https://developer.apple.com/library/ios/documentation/AppleApplications/Reference/SafariWebContent/PromotingAppswithAppBanners/PromotingAppswithAppBanners.html#//apple_ref/doc/uid/TP40002051-CH6-SW2\r\n\r\n\r\nh4. Extra information\r\n\r\nERROR] The application has crashed with an uncaught exception 'NSInvalidArgumentException'.\r\nReason:\r\n\r\nsetObjectForKey: object cannot be nil (key: source)\r\nStack trace:\r\nI think the issue is related to launchOptions dictionary.\r\nhttp://docs.appcelerator.com/titanium/3.0/#!/api/launchOptions\r\n\r\nIt seems that Titanium code doesn't check and set nil value where it cannot be nil.\r\n\r\nh4. Steps to reproduce\r\nGet the app from here: \r\n\r\nTapHunter - The Craft Beer Finder \r\nhttps://itunes.apple.com/us/app/taphunter-craft-beer-finder/id512023104?mt=8\r\n\r\n(anyone compiled with the latest 3.2.3 SDK). \r\n\r\nHow to reproduce: \r\n1) Download an app (one of the mentioned above or any other you know that was built using latest SDK and are in app store) \r\n2) Create a html page with the following meta tag:\r\n\r\n\r\n\r\nWhere 512023104 is the \"TapHunter - The Craft Beer Finder\" app id but can be your app id or 421224709 if you want to try with \"Farm Progress\".\r\n\r\n3) Open this page using safari on your device with the installed app \r\n4) Click on Smart Banner \"OPEN\" link and app will crash right after the launch", "attachment": [], "flagged": false, "summary": "iOS Safari Smart App Banner: non-empty \"app-argument\" crashes an app", "creator": { "name": "vlad1k", "key": "vlad1k", "displayName": "Vlad Y.", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "vlad1k", "key": "vlad1k", "displayName": "Vlad Y.", "active": true, "timeZone": "America/New_York" }, "environment": "Titanium SDK version 3.2.2.GA\r\nTested on iOS 6.1.3 and iOS 7.1", "comment": { "comments": [ { "id": "298750", "author": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Please provide a simple runnable test case to reproduce this issue and we would be happy to take a look.", "updateAuthor": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-03-26T05:01:18.000+0000", "updated": "2014-03-26T05:01:18.000+0000" }, { "id": "298807", "author": { "name": "vlad1k", "key": "vlad1k", "displayName": "Vlad Y.", "active": true, "timeZone": "America/New_York" }, "body": "\n\n\nI will explain how to reproduce and where I think you should look for the issue.\n\nSmart App Banners work on real device only and for the apps that are in the App Store (Safari needs a real numeric itunes app id).\n\n\nI tried and was able to crash some other apps that are available on this page\nto prove that this is Titanium and not an app specific issue:\nhttp://www.appcelerator.com/customers/app-showcase/\n\ne.g.\nFarm Progress\nhttps://itunes.apple.com/us/app/farm-progress/id421224709?mt=8\n\nTapHunter - The Craft Beer Finder\nhttps://itunes.apple.com/us/app/taphunter-craft-beer-finder/id512023104?mt=8\n\n\nI tried a bunch of apps but it seems that issue is reproducible for the ones that were updated in 2014.\nI was not able to reproduce it for the late 2013 apps.\nSo we are talking about one of the latest versions of Titanium SDK.\n\nHow to reproduce:\n1) Download an app (one of the mentioned above or any other you know that was built using latest SDK and are in app store)\n2) Create a html page with the following meta tag:\n\n\n\nWhere 512023104 is the \"TapHunter - The Craft Beer Finder\" app id but can be your app id or 421224709 if you want to try with \"Farm Progress\".\n\n\n3) Open this page using safari on your device with the installed app\n4) Click on Smart Banner \"OPEN\" link and app will crash right after the launch\n\n\nDevice console has the same error message for all apps:\n\n[ERROR] The application has crashed with an uncaught exception 'NSInvalidArgumentException'.\n\tReason:\n\t*** setObjectForKey: object cannot be nil (key: source)\n\tStack trace:\n\n\nI think the issue is related to launchOptions dictionary.\nhttp://docs.appcelerator.com/titanium/3.0/#!/api/launchOptions\n\nIt seems that Titanium code doesn't check and set nil value where it cannot be nil.\n", "updateAuthor": { "name": "vlad1k", "key": "vlad1k", "displayName": "Vlad Y.", "active": true, "timeZone": "America/New_York" }, "created": "2014-03-26T16:11:50.000+0000", "updated": "2014-03-26T16:11:50.000+0000" }, { "id": "298813", "author": { "name": "vlad1k", "key": "vlad1k", "displayName": "Vlad Y.", "active": true, "timeZone": "America/New_York" }, "body": "If you want to test a custom version or add some debug logging. You can do this on a real app store app you own.\nYou need to install your app from app store then don't delete it but override it with your debug version using \"Deploy to iOS device\" in Titanium Studio.\nSmart Banner will work and will crash your app.", "updateAuthor": { "name": "vlad1k", "key": "vlad1k", "displayName": "Vlad Y.", "active": true, "timeZone": "America/New_York" }, "created": "2014-03-26T16:57:28.000+0000", "updated": "2014-03-26T16:57:28.000+0000" }, { "id": "299726", "author": { "name": "vlad1k", "key": "vlad1k", "displayName": "Vlad Y.", "active": true, "timeZone": "America/New_York" }, "body": "Were you able to reproduce the issue? Do you need anything else? ", "updateAuthor": { "name": "vlad1k", "key": "vlad1k", "displayName": "Vlad Y.", "active": true, "timeZone": "America/New_York" }, "created": "2014-04-03T15:55:46.000+0000", "updated": "2014-04-03T15:55:46.000+0000" }, { "id": "305477", "author": { "name": "efrancis", "key": "efrancis", "displayName": "Emmanuel Francis", "active": true, "timeZone": "Asia/Kolkata" }, "body": "This issue is still in 3.2.3 GA version.\r\nApp build on 3.2.3 GA works fine on iOS 6. I haven't tested but looks like it is an issue when build with 3.2.3 GA and running on iOS 7.1.1\r\n ", "updateAuthor": { "name": "efrancis", "key": "efrancis", "displayName": "Emmanuel Francis", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2014-05-19T09:14:04.000+0000", "updated": "2014-05-19T09:15:08.000+0000" }, { "id": "311569", "author": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "body": "Hello [~vlad1k]!\r\n\r\nThanks for your report! Do you have any testcase about how do you handle this argument in your mobile app?\r\n\r\nBest Regards, ", "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2014-06-30T07:08:20.000+0000", "updated": "2014-06-30T07:08:20.000+0000" }, { "id": "312152", "author": { "name": "vlad1k", "key": "vlad1k", "displayName": "Vlad Y.", "active": true, "timeZone": "America/New_York" }, "body": "You don't need any logic to handle this argument.\r\nThe problem is within Titanium. It crashes even before can reach any handler and crashes when there is no handler at all.\r\nJust pass an argument and you will see a crash.", "updateAuthor": { "name": "vlad1k", "key": "vlad1k", "displayName": "Vlad Y.", "active": true, "timeZone": "America/New_York" }, "created": "2014-07-02T21:48:55.000+0000", "updated": "2014-07-02T21:48:55.000+0000" }, { "id": "313156", "author": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "body": "Thanks for you report. The platform team will set the priority of this bug. ", "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2014-07-10T00:34:45.000+0000", "updated": "2014-07-10T00:34:45.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }