{ "id": "160943", "key": "TIMOB-23488", "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": [], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2016-06-20T03:32:18.000+0000", "created": "2016-06-09T15:36:13.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "5.3.0.GA", "android", "bug", "crash", "mapView", "ti.map" ], "versions": [ { "id": "17707", "name": "Release 5.3.0", "archived": false, "released": true, "releaseDate": "2016-06-04" } ], "issuelinks": [], "assignee": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-24T18:01:43.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 a window containing a map view is closed on android, it crashes with the exception included below. This used to work fine in 5.1.2.\r\n\r\nTo close the window just use the device back button (closing the window programatically, i.e. using the action bar home button causes the same effect).\r\n\r\nBelow I include a test case. Please note that you will have to configure some valid API KEY in your tiapp.xml file in order to test it\r\n\r\n{code:javascript}\r\nvar Map = require('ti.map');\r\n\r\n// Build main window\r\n\r\nvar win = Ti.UI.createWindow({});\r\nvar openMapButton = Ti.UI.createButton({title: 'open map'});\r\nwin.add(openMapButton);\r\n\r\nopenMapButton.addEventListener('click', function() {\r\n\tvar mapWin = createMapWin();\r\n\r\n\tmapWin.addEventListener('close', function() {\r\n\t\t// This code never runs. Using sdk 5.1.2.GA runs fine.\r\n\t\talert('this wont trigger');\r\n\t});\r\n\tmapWin.open();\r\n});\r\n\r\n\r\n// Build map window\r\n\r\nfunction createMapWin() {\r\n\tvar mapWin = Ti.UI.createWindow();\r\n\tvar resultsMapview = Map.createView({\r\n\t\tmapType: Map.NORMAL_TYPE\r\n\t});\r\n\r\n\tmapWin.add(resultsMapview);\r\n\r\n\treturn mapWin;\r\n}\r\n\r\nwin.open();\r\n\r\n{code}\r\n\r\n\r\nHere is the exception rised. \r\n\r\n{code:xml}\r\n[ERROR] TiApplication: (main) [125332,131828] Sending event: exception on thread: main msg:java.lang.RuntimeException: Unable to destroy activity {com.teamwire.messenger/org.appcelerator.titanium.TiActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.android.gms.maps.GoogleMap.clear()' on a null object reference; Titanium 5.3.0,2016/06/01 10:18,94fa8af\r\n[ERROR] TiApplication: java.lang.RuntimeException: Unable to destroy activity {com.teamwire.messenger/org.appcelerator.titanium.TiActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.android.gms.maps.GoogleMap.clear()' on a null object reference\r\n{code}", "attachment": [], "flagged": false, "summary": "Closing a window with a map view added crashes the app (android)", "creator": { "name": "jaraen", "key": "jaraen", "displayName": "Javier Rayon", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jaraen", "key": "jaraen", "displayName": "Javier Rayon", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Android 4.1, 4.3, 6\r\nTitanium 5.3.0.GA\r\nTi.Map (tested versions from 2.2.5 to 2.3.4)", "closedSprints": [ { "id": 649, "state": "closed", "name": "2016 Sprint 13 SDK", "startDate": "2016-06-18T00:25:17.303Z", "endDate": "2016-07-02T00:25:00.000Z", "completeDate": "2016-07-04T04:25:16.889Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "388198", "author": { "name": "jaraen", "key": "jaraen", "displayName": "Javier Rayon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "seems that problem is solved with Ti.Map 2.3.6, I didn't realized that there was a newer version than 2.3.4 till now.", "updateAuthor": { "name": "jaraen", "key": "jaraen", "displayName": "Javier Rayon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-06-13T10:16:07.000+0000", "updated": "2016-06-13T10:16:07.000+0000" }, { "id": "415611", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as invalid with reference to the above comments.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-24T18:01:43.000+0000", "updated": "2017-03-24T18:01:43.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }