{ "id": "103006", "key": "TIMOB-11334", "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": [ { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" }, { "id": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" }, { "id": "14165", "description": "2012 Sprint 21 API", "name": "2012 Sprint 21 API", "archived": true, "released": true, "releaseDate": "2012-10-22" }, { "id": "14273", "description": "2012 Sprint 21", "name": "2012 Sprint 21", "archived": true, "released": true, "releaseDate": "2012-10-22" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-10-17T23:23:16.000+0000", "created": "2012-10-09T23:09:16.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "ios", "module_geolocation", "qe-ios100112", "qe-testadded", "regression" ], "versions": [ { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "issuelinks": [], "assignee": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2012-10-17T23:23:16.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "While testing Geolocation Module I noticed crash on launch on *ios 5.1 - 5.1.1* with console [ERROR] The application has crashed with an uncaught exception 'NSRangeException'.\r\n\r\n*It is a regression, does not occur on 2.1.3*\r\n\r\nTest steps:\r\n1. Run this code below\r\n{code}\r\nvar win = Titanium.UI.createWindow({ \r\n backgroundColor:'#fff',\r\n exitOnClose: true\r\n})\r\nTi.Geolocation.preferredProvider = \"gps\";\r\n\t\t\r\n\t\t\r\n\t\tif(Titanium.Geolocation.locationServicesEnabled === false) {\r\n\t\t\tTitanium.UI.createAlertDialog({\r\n\t\t\t\ttitle : 'Kitchen Sink',\r\n\t\t\t\tmessage : 'Your device has geo turned off - turn it on.'\r\n\t\t\t}).show();\r\n\t\t} else {\r\n\t\t\tif(Titanium.Platform.name != 'android') {\r\n\t\t\t\tvar authorization = Titanium.Geolocation.locationServicesAuthorization;\r\n\t\t\t\t\r\n\t\t\t\tif(authorization == Titanium.Geolocation.AUTHORIZATION_DENIED) {\r\n\t\t\t\t\tTi.UI.createAlertDialog({\r\n\t\t\t\t\t\ttitle : 'TIMOB_3077',\r\n\t\t\t\t\t\tmessage : 'You need to allow geolaction for this test.'\r\n\t\t\t\t\t}).show();\r\n\t\t\t\t} \r\n\t\t\t}\r\n\r\n\t\t\t//\r\n\t\t\t// IF WE HAVE COMPASS GET THE HEADING\r\n\t\t\t//\r\n\t\t\tif(Titanium.Geolocation.hasCompass) {\r\n\t\t\t\t//\r\n\t\t\t\t// TURN OFF ANNOYING COMPASS INTERFERENCE MESSAGE\r\n\t\t\t\t//\r\n\t\t\t\tTitanium.Geolocation.showCalibration = false;\r\n\r\n\t\t\t\t//\r\n\t\t\t\t// SET THE HEADING FILTER (THIS IS IN DEGREES OF ANGLE CHANGE)\r\n\t\t\t\t// EVENT WON'T FIRE UNLESS ANGLE CHANGE EXCEEDS THIS VALUE\r\n\t\t\t\tTitanium.Geolocation.headingFilter = 1;\r\n\r\n\t\t\t\t//\r\n\t\t\t\t// EVENT LISTENER FOR COMPASS EVENTS - THIS WILL FIRE REPEATEDLY (BASED ON HEADING FILTER)\r\n\t\t\t\t//\r\n\t\t\t\tvar headingCallback = function(e) {\r\n\r\n\t\t\t\t\tvar x = e.heading.x;\r\n\t\t\t\t\tvar y = e.heading.y;\r\n\t\t\t\t\tvar z = e.heading.z;\r\n\t\t\t\t\tvar magneticHeading = e.heading.magneticHeading;\r\n\t\t\t\t\tvar accuracy = e.heading.accuracy;\r\n\t\t\t\t\tvar trueHeading = e.heading.trueHeading;\r\n\t\t\t\t\tvar timestamp = e.heading.timestamp;\r\n\t\t\t\t\t\r\n\t\t\t\t\tTi.API.debug('True heading should be less than 360 and is:' + e.heading.trueHeading);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(e.heading.trueheading >= 360) {\r\n\t\t\t\t\t\talert('True heading should be less than 360 and is:' + e.heading.trueHeading);\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\t\t\t\tTitanium.Geolocation.addEventListener('heading', headingCallback);\r\n\t\t\t\theadingAdded = true;\r\n\t\t\t} else {\r\n\t\t\t\tTitanium.API.info(\"No Compass on device\");\r\n\t\t\t}\r\n\r\n\t\t\t//\r\n\t\t\t// SET ACCURACY - THE FOLLOWING VALUES ARE SUPPORTED\r\n\t\t\t//\r\n\t\t\tTitanium.Geolocation.accuracy = Titanium.Geolocation.ACCURACY_BEST;\r\n\r\n\t\t\t//\r\n\t\t\t// SET DISTANCE FILTER. THIS DICTATES HOW OFTEN AN EVENT FIRES BASED ON THE DISTANCE THE DEVICE MOVES\r\n\t\t\t// THIS VALUE IS IN METERS\r\n\t\t\t//\r\n\t\t\tTitanium.Geolocation.distanceFilter = 10;\r\n\r\n\t\t\t//\r\n\t\t\t// GET CURRENT POSITION - THIS FIRES ONCE\r\n\t\t\t//\r\n\t\t\tTitanium.Geolocation.getCurrentPosition(function(e) {});\r\n\t\t\t//\r\n\t\t\t// EVENT LISTENER FOR GEO EVENTS - THIS WILL FIRE REPEATEDLY (BASED ON DISTANCE FILTER)\r\n\t\t\t//\r\n\t\t\tvar locationCallback = function(e) {};\r\n\t\t\tTitanium.Geolocation.addEventListener('location', locationCallback);\r\n\t\t\tlocationAdded = true;\r\n\t\t}\r\n\t\twin.open();\r\n{code}\r\n2. The log returns ERROR] The application has crashed with an uncaught exception 'NSRangeException'.\r\n\tReason:\r\n\t*** -[__NSArrayI objectAtIndex:]: index 0 beyond bounds for empty array", "attachment": [ { "id": "32483", "filename": "Crash.crash", "author": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-10-09T23:09:16.000+0000", "size": 31459, "mimeType": "application/octet-stream" } ], "flagged": false, "summary": "iOS: Geolocation - Crash on app launch", "creator": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Tested on:\r\nTitanium Studio, build: 3.0.0.201210090117\r\nTitanium SDK, build: 3.0.0.v20121009111437\r\nDevices:\r\niPad3 ios 5.1.1\r\niPhone4 ios 5.1.1\r\n", "comment": { "comments": [ { "id": "222838", "author": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Mea Culpa.\nPR pending..https://github.com/appcelerator/titanium_mobile/pull/3145", "updateAuthor": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-10-10T00:38:41.000+0000", "updated": "2012-10-10T00:38:41.000+0000" }, { "id": "224111", "author": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified fix with:\nTitanium Studio, build: 3.0.0.201210151149\nTitanium Studio SDK, build3.0.0.v20121017102440\nDevices:\niPhone5 ios 6.0\niPad2 ios 5.1\n\nClosing the bug.", "updateAuthor": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-10-17T23:23:06.000+0000", "updated": "2012-10-17T23:23:06.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }