{ "id": "153597", "key": "TIMOB-20102", "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": "17706", "name": "Release 5.4.0", "archived": false, "released": true, "releaseDate": "2016-08-11" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2017-02-17T14:41:52.000+0000", "created": "2015-12-03T21:32:31.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [], "versions": [], "issuelinks": [ { "id": "50543", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "154773", "key": "TIMOB-20356", "fields": { "summary": "Android Marshmallow is not showing geolocation request alert", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-02-17T14:41:58.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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "When you try to use Geolocation to discover position (getCurrentPosition), returns error on Android Log: (KrollRuntimeThread) Location permissions missing. The callback is not fired.\r\n\r\nSDK : 5.1.1.GA\r\nAndroid 6.0\r\n\r\nSDK 5.0.2.GA works fine", "attachment": [], "flagged": false, "summary": "Android 6.0 - 5.1.1.GA - Location permissions missing", "creator": { "name": "flaviolacer", "key": "flaviolacer", "displayName": "Flavio Lacerda", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "flaviolacer", "key": "flaviolacer", "displayName": "Flavio Lacerda", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Android 6.0\r\nTitanium SDK 5.1.1.GA", "closedSprints": [ { "id": 839, "state": "closed", "name": "2017 Sprint 04 SDK", "startDate": "2017-02-12T23:36:00.961Z", "endDate": "2017-02-26T23:36:00.000Z", "completeDate": "2017-02-26T17:38:54.172Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "372267", "author": { "name": "jnaher", "key": "jnaher", "displayName": "Jebun Naher", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello,\r\n\r\nWe tested this issue and observed that getCurrentPosition() is not working as expected on Android 6. On Android 4.4.2 it's working as expected. \r\n\r\n*Testing Environment:*\r\nTitanium SDK version 5.1.1.GA\r\nAppcelerator Studio, build: 4.4.0.201511241829\r\nMac OS X Version = 10.11.1\r\nArchitecture = 64bit\r\nNode.js Version = 0.12.7\r\nnpm Version = 2.11.3\r\nAppcelerator CLI Installer = 4.2.2\r\nCore Package = 5.1.0\r\nTitanium CLI Version = 5.0.5\r\nnode-appc Version = 0.2.31\r\nAndroid device: Nexus 7(android 6)\r\nSamsung Tab: Android (4.4.2)\r\n*Test Case:*\r\n{code}\r\nvar map=require('ti.map');\r\nvar win = Ti.UI.createWindow();\r\nTitanium.Geolocation.purpose = \"Recieve User Location\";\r\nTitanium.Geolocation.accuracy = Titanium.Geolocation.ACCURACY_BEST;\r\n// Set Distance filter. This dictates how often an event fires based on the distance the device moves. This value is in meters.\r\nTitanium.Geolocation.distanceFilter = 10;\r\n//set the mapview with the current location\r\nvar mapview = Titanium.Map.createView({\r\n mapType: Titanium.Map.STANDARD_TYPE,\r\n animate:true,\r\n //region: {latitude:39.30109620906199, longitude:-76.60234451293945, latitudeDelta:0.1, longitudeDelta:0.1},\r\n regionFit:true,\r\n userLocation:true,\r\n visible: true,\r\n});\r\nfunction getLocation(){\r\n//Get the current position and set it to the mapview\r\nTitanium.Geolocation.getCurrentPosition(function(e){\r\n var region={\r\n latitude: e.coords.latitude,\r\n longitude: e.coords.longitude,\r\n animate:true,\r\n latitudeDelta:0.001,\r\n longitudeDelta:0.001\r\n };\r\n mapview.setLocation(region);\r\n});\r\n}\r\nwin.add(mapview);\r\nTitanium.Geolocation.addEventListener('location',function(){\r\n getLocation();\r\n});\r\nwin.open();\r\n{code}\r\n\r\n*Steps to test:*\r\n1. Create a classic project, replace app.js with the above code\r\n\r\nBuild and run the project on android version 4.4.2 and observe that the device location is seen.\r\nNow run the project on android 6 and observe that device location is not visible.\r\n\r\nThanks.\r\n", "updateAuthor": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-12-07T07:06:58.000+0000", "updated": "2015-12-22T17:48:54.000+0000" }, { "id": "373844", "author": { "name": "davidfischer", "key": "davidfischer", "displayName": "David Fischer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I'm seeing the same error. As far as I can tell, this is still an issue.", "updateAuthor": { "name": "davidfischer", "key": "davidfischer", "displayName": "David Fischer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-01-05T20:39:45.000+0000", "updated": "2016-01-05T20:39:45.000+0000" }, { "id": "373845", "author": { "name": "davidfischer", "key": "davidfischer", "displayName": "David Fischer", "active": true, "timeZone": "America/Los_Angeles" }, "updateAuthor": { "name": "davidfischer", "key": "davidfischer", "displayName": "David Fischer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-01-05T20:41:12.000+0000", "updated": "2016-01-05T20:41:12.000+0000" }, { "id": "373855", "author": { "name": "davidfischer", "key": "davidfischer", "displayName": "David Fischer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Downgrading to 5.0.2.GA and downgrading node.js to 0.12 worked for me.", "updateAuthor": { "name": "davidfischer", "key": "davidfischer", "displayName": "David Fischer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-01-05T22:17:41.000+0000", "updated": "2016-01-05T22:17:41.000+0000" }, { "id": "373922", "author": { "name": "davidfischer", "key": "davidfischer", "displayName": "David Fischer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Is it possible to get this ticket re-opened and re-looked at. It was closed out without comment as simply \"can't reproduce\" but it does seem to be affecting multiple users.", "updateAuthor": { "name": "davidfischer", "key": "davidfischer", "displayName": "David Fischer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-01-06T18:42:58.000+0000", "updated": "2016-01-06T18:42:58.000+0000" }, { "id": "374763", "author": { "name": "matthewphewes", "key": "matthewphewes", "displayName": "Matthew Hewes", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Has a workaround other than downgrading to 5.0.2 been found for this? I'm having the issue on 5.1.2.GA as well... Android 6.0 cannot find location. and repeatedly spits out this error:\r\n\r\n{color:red}[ERROR] : GeolocationModule: (KrollRuntimeThread) [2002,271792] Location permissions missing{color}", "updateAuthor": { "name": "matthewphewes", "key": "matthewphewes", "displayName": "Matthew Hewes", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-01-17T21:26:00.000+0000", "updated": "2016-01-17T21:26:00.000+0000" }, { "id": "375302", "author": { "name": "ryanbuening", "key": "ryanbuening", "displayName": "Ryan Buening", "active": true, "timeZone": "America/New_York" }, "body": "I'm also getting this error on SDK 5.1.2 GA.\r\n\r\n[ERROR] : GeolocationModule: (KrollRuntimeThread) [9525,9525] Location permissions missing\r\n\r\nMy AndroidManifest has the following location permissions:\r\n\r\n\t\r\n\t\r\n\t\r\n\r\nTrying to run: Titanium.Geolocation.getCurrentPosition(function(e) {", "updateAuthor": { "name": "ryanbuening", "key": "ryanbuening", "displayName": "Ryan Buening", "active": true, "timeZone": "America/New_York" }, "created": "2016-01-26T18:20:37.000+0000", "updated": "2016-01-26T18:24:12.000+0000" }, { "id": "376218", "author": { "name": "Ventis", "key": "ventis", "displayName": "David Vermeir", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Getting the same error on Nexus 5 with Android 6 and 5.1.2.GA. Reverting to 5.0.2 it works again.\r\nPlease reopen this ticket!\r\n\r\nI'm guessing this has something to do with this: http://developer.android.com/training/permissions/requesting.html\r\n\r\nSince I'm targeting API 23 and running Android 6.0 but I'm not getting a request for location permissions at runtime.", "updateAuthor": { "name": "Ventis", "key": "ventis", "displayName": "David Vermeir", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-02-08T11:42:58.000+0000", "updated": "2016-02-08T12:10:55.000+0000" }, { "id": "376222", "author": { "name": "Ventis", "key": "ventis", "displayName": "David Vermeir", "active": true, "timeZone": "America/Los_Angeles" }, "body": "For those of you still waiting for a fix but who don't want to downgrade the Titanium SDK, here's a solution:\r\nSince Android 6.0 it's not sufficient to just declare your permissions in the manifest, you have to ask for it at runtime.\r\nTranslating this to Titanium:\r\n\r\n{noformat}\r\nif(!Titanium.Geolocation.hasLocationPermissions(Titanium.Geolocation.AUTHORIZATION_ALWAYS)) {\r\nTitanium.Geolocation.requestLocationPermissions(Titanium.Geolocation.AUTHORIZATION_ALWAYS, function(result){\r\n\t\tif(!result.success) {\r\n\t\t\t//no location permissions flow triggers\r\n\t\t} else {\r\n\t\t\t//do something\r\n\t\t}\r\n\t});\r\n}\r\n{noformat}\r\n", "updateAuthor": { "name": "Ventis", "key": "ventis", "displayName": "David Vermeir", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-02-08T12:40:38.000+0000", "updated": "2016-02-08T12:41:57.000+0000" }, { "id": "384624", "author": { "name": "olearyj234", "key": "olearyj234", "displayName": "James O'Leary", "active": true, "timeZone": "America/New_York" }, "body": "Replicated this problem(callback not called on getcurrentposition)\r\nTi SDK 5.2.2\r\nAndroid 6.0", "updateAuthor": { "name": "olearyj234", "key": "olearyj234", "displayName": "James O'Leary", "active": true, "timeZone": "America/New_York" }, "created": "2016-05-03T18:59:43.000+0000", "updated": "2016-05-03T18:59:43.000+0000" }, { "id": "386044", "author": { "name": "chandan", "key": "chandan", "displayName": "Chandan Sharma", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I am also getting same error!!!\r\n\r\nCallback function getcurrentposition() is not getting called even if Titanium.Geolocation.AUTHORIZATION_ALWAYS permission is granted", "updateAuthor": { "name": "chandan", "key": "chandan", "displayName": "Chandan Sharma", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-05-18T11:18:48.000+0000", "updated": "2016-05-18T11:18:48.000+0000" }, { "id": "387401", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "[~chandan] Did you request the permission at runtime?", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-06-02T08:30:41.000+0000", "updated": "2016-06-02T08:30:41.000+0000" }, { "id": "387497", "author": { "name": "chandan", "key": "chandan", "displayName": "Chandan Sharma", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Yes added runtime permission to access camera like as below: \r\n\r\n\r\n[if(!Titanium.Geolocation.hasLocationPermissions(Titanium.Geolocation.AUTHORIZATION_ALWAYS)) {\r\nTitanium.Geolocation.requestLocationPermissions(Titanium.Geolocation.AUTHORIZATION_ALWAYS, function(result){\r\n\t\tif(!result.success) {\r\n\t\t\t//no location permissions flow triggers\r\n\t\t} else {\r\n\t\t\t//do something\r\n\t\t}\r\n\t});\r\n}]", "updateAuthor": { "name": "chandan", "key": "chandan", "displayName": "Chandan Sharma", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-06-03T08:29:31.000+0000", "updated": "2016-06-03T08:29:31.000+0000" }, { "id": "389861", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "To see which permissions that's really needed and what's not requested, inside Android you can go to:\r\nSettings>Apps>\"YourAppName\">Permissions>\r\n\r\nIf you can see what permission is not used or in use. You can click it to see if it helps.\r\n\r\nTo address this further, in 5.4.0 (future), you can use {{Ti.Android.requestPermissions()}}\r\nhttps://github.com/appcelerator/titanium_mobile/blob/ff3acd9a1f1ffcd82a634700e3457ce269e463fe/apidoc/Titanium/Android/Android.yml#L197-L212\r\n\r\nJira for ref: TIMOB-20320", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-07-04T04:11:09.000+0000", "updated": "2016-07-04T04:11:09.000+0000" } ], "maxResults": 23, "total": 23, "startAt": 0 } } }