{ "id": "168713", "key": "TIMOB-24916", "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": "18414", "description": "", "name": "Release 6.2.0", "archived": false, "released": true, "releaseDate": "2017-09-13" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2017-07-11T23:46:19.000+0000", "created": "2017-06-30T17:15:30.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [ { "id": "18414", "description": "", "name": "Release 6.2.0", "archived": false, "released": true, "releaseDate": "2017-09-13" } ], "issuelinks": [], "assignee": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2017-07-20T21:09:22.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": "When {{Ti.Geolocation.getLastGeolocation}} is called before a geoLocaiton has been set the application crashes and the log displays the following error. \r\n{code:java}\r\n[ERROR] : Script Error {\r\n[ERROR] : column = 967;\r\n[ERROR] : line = 1;\r\n[ERROR] : message = \"*** +[NSJSONSerialization dataWithJSONObject:options:error:]: value parameter is nil\";\r\n[ERROR] : sourceURL = \"file:///var/containers/Bundle/Application/E14637A6-6008-4878-868B-BE5E7555A790/T8.app/app.js\";\r\n[ERROR] : stack = \"[native code]\\nfile:///var/containers/Bundle/Application/E14637A6-6008-4878-868B-BE5E7555A790/T8.app/app.js:1:967\";\r\n[ERROR] : }\r\n{code}\r\nThis is different to Android and 6.1.1.GA where the log instead showed: \r\n{code:java}\r\n[DEBUG] : Location undefined\r\n{code}\r\n\r\n*Test Steps*\r\n1. Create a new titanium project using SDK version: 6.2.0.v20170630062735\r\n2. Add the following code to the {{app.js}}\r\n{code:java}\r\nTitanium.UI.setBackgroundColor('#000');\r\nvar win1 = Titanium.UI.createWindow({ \r\n title:'Geo Test',\r\n backgroundColor:'#fff'\r\n});\r\nvar label1 = Titanium.UI.createLabel({\r\n\tcolor:'#999',\r\n\ttext:'GEO TEST',\r\n\tfont:{fontSize:20,fontFamily:'Helvetica Neue'},\r\n\ttextAlign:'center',\r\n\twidth:'auto',top:280\r\n});\r\nwin1.add(label1);\r\n \r\nvar btn1 = Ti.UI.createButton({title:'Last analytics',top:10,left:10,right:10,height:80});\r\nbtn1.addEventListener('click',function(){Ti.API.debug('Event?'); label1.text = 'Event: ' + Ti.Analytics.lastEvent;});\r\nwin1.add(btn1);\r\n \r\nvar btn2 = Ti.UI.createButton({title:'Start Geo',top:100,left:10,right:10,height:80});\r\nbtn2.addEventListener('click',function(){Ti.API.debug('Geo Started!'); \r\n\r\n\tTitanium.Geolocation.addEventListener('location',function(e)\r\n\t\r\n\t{\r\n\t\tif (e.error)\r\n\t\t{\r\n\t\t\tlabel1.text = 'error: ' + e.error;\r\n\t\t\treturn;\r\n\t\t}\r\n\t});\r\n});\r\nwin1.add(btn2);\r\n\r\nvar btn3 = Ti.UI.createButton({title:'Get Geo',top:190,left:10,right:10,height:80});\r\nbtn3.addEventListener('click',function(){Ti.API.debug(\"Location \" + Ti.Geolocation.getLastGeolocation()); \r\n});\r\nwin1.add(btn3);\r\n\r\nwin1.open();\r\n{code}\r\n3. Run the application on an iOS device \r\n4. Once the application has launched press the {{Get Geo}} button \r\n\r\n*Expected result*\r\nApplication should not crash and the log should display the following message \r\n{code:java}\r\n[DEBUG] : Location undefined\r\n{code}\r\n\r\n*Actual result*\r\nApplication crashes and the above error message is displayed\r\n\r\nNOTE:* This could also be why some of the newer Jenkins builds have been failing as the test case for this failed in a few builds. \r\n", "attachment": [], "flagged": false, "summary": "[iOS] Application crashes when \"Ti.Geolocation.getLastGeolocation\" is called before a geoLocation is set ", "creator": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "SDK Version: 6.2.0.v20170630062735\r\nAppcelerator Command-Line Interface, version 6.2.2\r\nGoogle Nexus 6P (7.1.1)\r\nOperating System Name: Mac OS X El Capitan\r\nOperating System Version: 10.11.6\r\nNode.js Version: 6.10.1\r\nXcode: 8.2\r\nAppcelerator Studio: 4.9.0.201705251638", "comment": { "comments": [ { "id": "423302", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/9186", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-07-02T04:42:43.000+0000", "updated": "2017-07-02T04:42:43.000+0000" }, { "id": "424482", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified fix in SDK Version: 6.2.0.v20170719160617 . Test and other information can be found at: \r\nhttps://github.com/appcelerator/titanium_mobile/pull/9186 ", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-07-20T21:09:02.000+0000", "updated": "2017-07-20T21:09:02.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }