{ "id": "81659", "key": "AC-2866", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "8", "description": "", "name": "Needs more info" }, "resolutiondate": "2011-10-20T08:59:20.000+0000", "created": "2011-10-17T10:37:27.000+0000", "labels": [ "android", "geolocation", "services" ], "versions": [], "issuelinks": [], "assignee": { "name": "mapperson", "key": "mapperson", "displayName": "Matthew Apperson", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2016-03-08T07:47:49.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": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "I have an android background service that start a location listener. However, once you exit from the app while the service still runs the callback isn't called. The logs show that Titanium is throwing a NPE.\r\n\r\n\r\n10-17 12:56:05.792: ERROR/KrollEventManager(27494): (kroll$2) [2653,32869] Error invoking listener with id 2 on eventName 'location'\r\n10-17 12:56:05.792: ERROR/KrollEventManager(27494): java.lang.NullPointerException\r\n10-17 12:56:05.792: ERROR/KrollEventManager(27494): at org.appcelerator.kroll.KrollProxy.createEventInvocation(KrollProxy.java:657)\r\n10-17 12:56:05.792: ERROR/KrollEventManager(27494): at org.appcelerator.kroll.KrollProxy.fireSingleEvent(KrollProxy.java:669)\r\n10-17 12:56:05.792: ERROR/KrollEventManager(27494): at org.appcelerator.kroll.KrollEventManager$KrollListener.invoke(KrollEventManager.java:143)\r\n10-17 12:56:05.792: ERROR/KrollEventManager(27494): at org.appcelerator.kroll.KrollEventManager.dispatchEvent(KrollEventManager.java:273)\r\n10-17 12:56:05.792: ERROR/KrollEventManager(27494): at org.appcelerator.kroll.KrollEventManager.dispatchEvent(KrollEventManager.java:240)\r\n10-17 12:56:05.792: ERROR/KrollEventManager(27494): at org.appcelerator.kroll.KrollProxy.fireEvent(KrollProxy.java:642)\r\n10-17 12:56:05.792: ERROR/KrollEventManager(27494): at ti.modules.titanium.geolocation.TiLocation.onLocationChanged(TiLocation.java:107)\r\n10-17 12:56:05.792: ERROR/KrollEventManager(27494): at android.location.LocationManager$ListenerTransport._handleMessage(LocationManager.java:228)\r\n10-17 12:56:05.792: ERROR/KrollEventManager(27494): at android.location.LocationManager$ListenerTransport.access$000(LocationManager.java:160)\r\n10-17 12:56:05.792: ERROR/KrollEventManager(27494): at android.location.LocationManager$ListenerTransport$1.handleMessage(LocationManager.java:176)\r\n10-17 12:56:05.792: ERROR/KrollEventManager(27494): at android.os.Handler.dispatchMessage(Handler.java:99)\r\n10-17 12:56:05.792: ERROR/KrollEventManager(27494): at android.os.Looper.loop(Looper.java:150)\r\n10-17 12:56:05.792: ERROR/KrollEventManager(27494): at org.appcelerator.titanium.kroll.KrollHandlerThread.run(KrollHandlerThread.java:86)\r\n\r\nMore details / discussion can be found here:\r\nhttp://developer.appcelerator.com/question/126946/background-location-on-android\r\n\r\n", "attachment": [], "flagged": false, "summary": "Geolocation Location event cannot be processed in Android service", "creator": { "name": "tvfoodmaps", "key": "tvfoodmaps", "displayName": "Frank Apap", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "tvfoodmaps", "key": "tvfoodmaps", "displayName": "Frank Apap", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Mac OS X, Ti 1.7.3 (tried multiple builds). ", "comment": { "comments": [ { "id": "169499", "author": { "name": "tvfoodmaps", "key": "tvfoodmaps", "displayName": "Frank Apap", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Update:\r\nUpon further testing it appears a similar issue exists in the Kitchen Sink android service examples. The log messages stop when you back out of the app even though the service still shows to be running. I think the service runs but the fireEvent doesnt work.", "updateAuthor": { "name": "tvfoodmaps", "key": "tvfoodmaps", "displayName": "Frank Apap", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-10-17T17:28:46.000+0000", "updated": "2011-10-17T17:28:46.000+0000" }, { "id": "169521", "author": { "name": "tvfoodmaps", "key": "tvfoodmaps", "displayName": "Frank Apap", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Here is simple code snippet that demonstrates the issue: (this is the service):\r\n\r\n\r\nTi.API.info(\"Test Service running\");\r\n\r\n\r\nfunction tevt(){\r\n\tTi.API.debug(\"Event Ran\");\r\n\tTitanium.App.removeEventListener('test1',tevt);\r\n}\t\r\n\r\nTitanium.App.addEventListener('test1',tevt);\r\nTi.App.fireEvent('test1');\r\n\r\n\r\n", "updateAuthor": { "name": "tvfoodmaps", "key": "tvfoodmaps", "displayName": "Frank Apap", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-10-18T06:19:10.000+0000", "updated": "2011-10-18T06:19:10.000+0000" }, { "id": "169799", "author": { "name": "mapperson", "key": "mapperson", "displayName": "Matthew Apperson", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Frank,\r\n\r\nTo file a bug ticket, all relevant information needs to be included such as Android SDK version, as well at the exact build of the Ti SDK you are using.\r\n\r\nFor a full outline of all required information, please see our JIRA checklist here - http://wiki.appcelerator.org/display/guides/Contributing+to+Titanium#ContributingtoTitanium-Summary%3AJiraTicketChecklist\r\n\r\nBest regards,\r\nMatt", "updateAuthor": { "name": "mapperson", "key": "mapperson", "displayName": "Matthew Apperson", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-10-20T08:59:08.000+0000", "updated": "2011-10-20T08:59:08.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }