{ "id": "171354", "key": "TIMOB-25887", "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": "20102", "name": "Release 7.1.1", "archived": false, "released": true, "releaseDate": "2018-05-02" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-03-21T21:43:30.000+0000", "created": "2018-03-19T22:18:41.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "7.1.0.GA", "regression" ], "versions": [ { "id": "19957", "description": "", "name": "Release 7.1.0", "archived": false, "released": true, "releaseDate": "2018-03-14" } ], "issuelinks": [ { "id": "56448", "type": { "id": "10001", "name": "Cloners", "inward": "is cloned into", "outward": "is cloned from" }, "inwardIssue": { "id": "171488", "key": "TIMOB-25951", "fields": { "summary": "JavaObject Exception in Hyperloop Examples app", "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": "Critical", "id": "1" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "56399", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "155433", "key": "TIMOB-20522", "fields": { "summary": "FusedLocationProvider on Android", "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": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } } ], "assignee": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-04-10T09:25:14.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": "h5. Issue\r\nCustomer's app has an android service to get location data in the background. It is encountering an exception when it calls Ti.Geolocation.hasLocationPermissions(): \r\n\r\nThey are receiving the following error:\r\n{quote}03-19 08:43:48.855 2764 2764 E TiApplication: (main) [6,1875] No valid root or current activity found for application instance \r\n03-19 08:43:48.855 2764 2764 E KrollProxy: (main) [0,1875] Error creating proxy \r\n03-19 08:43:48.855 2764 2764 E KrollProxy: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.pm.PackageManager android.content.Context.getPackageManager()' on a null object reference \r\n03-19 08:43:48.855 2764 2764 E KrollProxy: at com.google.android.gms.common.zzo.isGooglePlayServicesAvailable(Unknown Source:4) \r\n03-19 08:43:48.855 2764 2764 E KrollProxy: at com.google.android.gms.common.zze.isGooglePlayServicesAvailable(Unknown Source:0) \r\n03-19 08:43:48.855 2764 2764 E KrollProxy: at com.google.android.gms.common.GoogleApiAvailability.isGooglePlayServicesAvailable(Unknown Source:0) \r\n03-19 08:43:48.855 2764 2764 E KrollProxy: at ti.modules.titanium.geolocation.android.FusedLocationProvider$PlayServices.available(FusedLocationProvider.java:184) \r\n03-19 08:43:48.855 2764 2764 E KrollProxy: at ti.modules.titanium.geolocation.android.FusedLocationProvider.hasPlayServices(FusedLocationProvider.java:80) \r\n03-19 08:43:48.855 2764 2764 E KrollProxy: at ti.modules.titanium.geolocation.android.FusedLocationProvider.(FusedLocationProvider.java:61) \r\n03-19 08:43:48.855 2764 2764 E KrollProxy: at ti.modules.titanium.geolocation.GeolocationModule.(GeolocationModule.java:219) \r\n03-19 08:43:48.855 2764 2764 E KrollProxy: at java.lang.Class.newInstance(Native Method) \r\n03-19 08:43:48.855 2764 2764 E KrollProxy: at org.appcelerator.kroll.KrollProxy.createProxy(KrollProxy.java:137) \r\n03-19 08:43:48.855 2764 2764 E KrollProxy: at org.appcelerator.kroll.runtime.v8.V8Runtime.nativeRunModule(Native Method) \r\n03-19 08:43:48.855 2764 2764 E KrollProxy: at org.appcelerator.kroll.runtime.v8.V8Runtime.doRunModule(V8Runtime.java:187) \r\n03-19 08:43:48.855 2764 2764 E KrollProxy: at org.appcelerator.kroll.KrollRuntime.handleMessage(KrollRuntime.java:325) \r\n03-19 08:43:48.855 2764 2764 E KrollProxy: at android.os.Handler.dispatchMessage(Handler.java:102) \r\n03-19 08:43:48.855 2764 2764 E KrollProxy: at android.os.Looper.loop(Looper.java:164) \r\n03-19 08:43:48.855 2764 2764 E KrollProxy: at android.app.ActivityThread.main(ActivityThread.java:6494) \r\n03-19 08:43:48.855 2764 2764 E KrollProxy: at java.lang.reflect.Method.invoke(Native Method) \r\n03-19 08:43:48.855 2764 2764 E KrollProxy: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) \r\n03-19 08:43:48.855 2764 2764 E KrollProxy: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) \r\n03-19 08:43:48.855 2764 2764 E JavaObject: !!! OH NO! We tried to grab a Java Object back out of the reference table, but it must have been GC'd, because it's null! Key: 15 \r\n03-19 08:43:48.855 2764 2764 I TiAPI : We do not have location permissions. Exiting. {quote}\r\n\r\nThe exception does not seem to make the service crash, but it doesn't think that it has location permissions (which it definitely does). So they are not getting any location data. \r\n\r\nh5. Code to create Android service: \r\n{code}var location_service_intent = Ti.Android.createServiceIntent( { url: 'LocationService.js' } ); \r\nlocation_service_intent.putExtra('interval', 600000); \r\n\r\nif (!Ti.Android.isServiceRunning(location_service_intent)) { \r\nTi.Android.startService(location_service_intent); \r\n} {code}\r\n\r\nh5. Service Code: \r\nUses a module to do all the location detection and updating with the back-end service provider.\r\n{code}Titanium.API.info(\"[LocationService] loaded\"); \r\n\r\nvar WxAlertSubscriptionUpdater = require ('/util/WxAlertSubscriptionUpdater'); \r\nWxAlertSubscriptionUpdater.register(); \r\n{code}\r\n\r\nh5. Additional information \r\n- issue not in SDK 7.0.2 \r\n- the WxAlertSubscriptionUpdater module is shared by the app and the service; the app doesn't have this problem when it talks to the Geolocation module \r\n- They have been unable to replicate this problem with a minimal test app; it's possible that a test app is too small to make garbage collection happen? ", "attachment": [], "flagged": false, "summary": "Android: Ti.Geolocation - Exception when calling Ti.Geolocation.hasLocationPermissions()", "creator": { "name": "vvazquezmontero", "key": "vvazquezmontero", "displayName": "Victor Vazquez Montero", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "vvazquezmontero", "key": "vvazquezmontero", "displayName": "Victor Vazquez Montero", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "closedSprints": [ { "id": 1008, "state": "closed", "name": "2018 Sprint 06 SDK", "startDate": "2018-03-11T22:18:04.396Z", "endDate": "2018-03-25T22:18:00.000Z", "completeDate": "2018-03-25T21:52:36.683Z", "originBoardId": 216 } ], "comment": { "comments": [ { "id": "435776", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "master: https://github.com/appcelerator/titanium_mobile/pull/9950", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-03-20T21:25:37.000+0000", "updated": "2018-03-20T21:25:37.000+0000" }, { "id": "435818", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Backport: https://github.com/appcelerator/titanium_mobile/pull/9951", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-03-21T21:21:00.000+0000", "updated": "2018-03-21T21:21:00.000+0000" }, { "id": "435820", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed.\r\nPR's merged.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-03-21T21:43:24.000+0000", "updated": "2018-03-21T21:43:24.000+0000" }, { "id": "435969", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified fix in SDK version 7.1.1.v20180326111446 and SDK Version 7.2.0.v20180326104918\r\n\r\nTest and other information can be found at: \r\nMaster: https://github.com/appcelerator/titanium_mobile/pull/9950\r\n7_1_X: https://github.com/appcelerator/titanium_mobile/pull/9951", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-03-27T13:39:08.000+0000", "updated": "2018-03-27T13:39:08.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }