{ "id": "170690", "key": "TIMOB-25636", "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": "20115", "name": "Release 7.3.0", "archived": false, "released": true, "releaseDate": "2018-08-17" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-05-16T00:00:27.000+0000", "created": "2017-12-28T16:44:50.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "ScrollableView", "android" ], "versions": [ { "id": "19988", "description": "", "name": "Release 7.0.1", "archived": false, "released": true, "releaseDate": "2017-12-21" } ], "issuelinks": [], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-05-16T00:00:30.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": "Hi,\r\n\r\nWe are migrating our app from 6.3.0GA Ti SDK to 7.0.0.GA SDK and we are facing couple of issues:\r\n\r\n1. In a window, we are using scrollable view and on close of window we are emptying the views of scrollable view by using scrollableView.views = []. with 6.3.0.GA it is working fine but with 7.0.0.GA we are getting error stating \r\n{code}\r\n“TiApplication: (main) [16638,27440] Sending event: exception on thread: main msg:java.lang.RuntimeException: Unable to destroy activity {com.hthworldwide.GeoBlue/org.appcelerator.titanium.TiActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void ti.modules.titanium.ui.widget.TiUIScrollableView.setViews(java.lang.Object)' on a null object reference; Titanium 7.0.1,2017/12/18 10:42,undefined”\r\n{code}\r\n2. In a window, we are using activity indicator and on close of that window we are hiding activity indicator by activityIndicator.hide(). with 6.3.0.GA it is working fine but with 7.0.0.GA we are getting error stating \r\n{code}\r\n“TiApplication(16766): (main) [21008,142400] Sending event: exception on thread: main msg:java.lang.NullPointerException: Attempt to invoke virtual method 'void ti.modules.titanium.ui.widget.TiUIActivityIndicator.hide()' on a null object reference; Titanium 7.0.1,2017/12/18 10:42,undefined”\r\n{code}\r\n\r\n\r\nSteps to reproduce the issues:\r\n1. Create a sample classic project\r\n2. Copy the attached files and paste them into resources folder\r\n3. Run the App on android device\r\n4. Click on the label “click to view scrollable window”, once window is opened click on android back button.\r\n5. Click on label “click to show indicator”, once window is opened click on android back button.\r\n\r\n\r\nNote : This is an issue in android platform. \r\nEven tried with 7.0.1.GA sdk still we are facing these issues.\r\n", "attachment": [ { "id": "63864", "filename": "activityIndWin.js", "author": { "name": "aislam", "key": "aislam", "displayName": "Aminul Islam", "active": false, "timeZone": "Etc/GMT-6" }, "created": "2017-12-28T16:43:41.000+0000", "size": 847, "mimeType": "text/javascript" }, { "id": "63863", "filename": "app.js", "author": { "name": "aislam", "key": "aislam", "displayName": "Aminul Islam", "active": false, "timeZone": "Etc/GMT-6" }, "created": "2017-12-28T16:43:41.000+0000", "size": 567, "mimeType": "text/javascript" }, { "id": "65128", "filename": "ScrollableViewCloseTest.js", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-05-03T23:37:33.000+0000", "size": 739, "mimeType": "application/x-javascript" }, { "id": "63862", "filename": "scrollableWin.js", "author": { "name": "aislam", "key": "aislam", "displayName": "Aminul Islam", "active": false, "timeZone": "Etc/GMT-6" }, "created": "2017-12-28T16:43:41.000+0000", "size": 831, "mimeType": "text/javascript" } ], "flagged": false, "summary": "Android: Calling ScrollableView's setters causes a crash if parent window is closed as of 7.0.0", "creator": { "name": "aislam", "key": "aislam", "displayName": "Aminul Islam", "active": false, "timeZone": "Etc/GMT-6" }, "subtasks": [], "reporter": { "name": "aislam", "key": "aislam", "displayName": "Aminul Islam", "active": false, "timeZone": "Etc/GMT-6" }, "environment": null, "closedSprints": [ { "id": 1000, "state": "closed", "name": "2018 Sprint 04 SDK", "startDate": "2018-02-12T04:23:01.913Z", "endDate": "2018-02-26T04:23:00.000Z", "completeDate": "2018-02-26T19:36:01.769Z", "originBoardId": 114 }, { "id": 126, "state": "closed", "name": "2018 Sprint 05 SDK", "startDate": "2018-02-25T19:38:08.926Z", "endDate": "2018-03-11T18:38:00.000Z", "completeDate": "2018-03-11T22:06:01.520Z", "originBoardId": 100 } ], "comment": { "comments": [ { "id": "432770", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I'm able to reproduce this issue in Titanium 7.0.0 with the following code:\r\n\r\n{code:javascript}\r\nvar window = Ti.UI.createWindow();\r\nvar scrollableView = Ti.UI.createScrollableView(\r\n{\r\n\tviews:\r\n\t[\r\n\t\tTi.UI.createLabel({ text: \"Page 1\" }),\r\n\t\tTi.UI.createLabel({ text: \"Page 2\" }),\r\n\t\tTi.UI.createLabel({ text: \"Page 3\" }),\r\n\t\tTi.UI.createLabel({ text: \"Page 4\" }),\r\n\t],\r\n\tshowPagingControl: true,\r\n});\r\nwindow.add(scrollableView);\r\nwindow.addEventListener(\"close\", function(e) {\r\n\tvar view = Ti.UI.createView();\r\n\tscrollableView.addView(view);\r\n\tscrollableView.insertViewsAt(0, [Ti.UI.createView()]);\r\n\tscrollableView.removeView(view);\r\n\tscrollableView.moveNext();\r\n\tscrollableView.movePrevious();\r\n\tscrollableView.scrollToView(0);\r\n\tscrollableView.currentPage = 1;\r\n\tscrollableView.scrollingEnabled = false;\r\n\tscrollableView.views = [];\r\n});\r\nwindow.open();\r\n{code}\r\n\r\n*Result:*\r\nCrashes with exception...\r\n{code}\r\n[WARN] : W/System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'void ti.modules.titanium.ui.widget.TiUIScrollableView.addView(org.appcelerator.titanium.proxy.TiViewProxy)' on a null object reference\r\n[WARN] : W/System.err: \tat ti.modules.titanium.ui.ScrollableViewProxy.handleMessage(ScrollableViewProxy.java:114)\r\n[WARN] : W/System.err: \tat android.os.Handler.dispatchMessage(Handler.java:101)\r\n[WARN] : W/System.err: \tat org.appcelerator.kroll.common.TiMessenger.sendMessage(TiMessenger.java:323)\r\n[WARN] : W/System.err: \tat org.appcelerator.kroll.common.TiMessenger.sendBlockingMessage(TiMessenger.java:289)\r\n[WARN] : W/System.err: \tat org.appcelerator.kroll.common.TiMessenger.sendBlockingMainMessage(TiMessenger.java:164)\r\n[WARN] : W/System.err: \tat ti.modules.titanium.ui.ScrollableViewProxy.addView(ScrollableViewProxy.java:176)\r\n[WARN] : W/System.err: \tat org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method)\r\n[WARN] : W/System.err: \tat org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62)\r\n[WARN] : W/System.err: \tat org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:934)\r\n[WARN] : W/System.err: \tat org.appcelerator.kroll.KrollProxy.fireSyncEvent(KrollProxy.java:807)\r\n[WARN] : W/System.err: \tat org.appcelerator.titanium.proxy.TiWindowProxy.closeFromActivity(TiWindowProxy.java:206)\r\n[WARN] : W/System.err: \tat org.appcelerator.titanium.TiBaseActivity.onDestroy(TiBaseActivity.java:1518)\r\n[WARN] : W/System.err: \tat org.appcelerator.titanium.TiActivity.onDestroy(TiActivity.java:32)\r\n[WARN] : W/System.err: \tat android.app.Activity.performDestroy(Activity.java:7177)\r\n[WARN] : W/System.err: \tat android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1248)\r\n[WARN] : W/System.err: \tat android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4425)\r\n[WARN] : W/System.err: \tat android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4456)\r\n[WARN] : W/System.err: \tat android.app.ActivityThread.-wrap5(Unknown Source:0)\r\n[WARN] : W/System.err: \tat android.app.ActivityThread$H.handleMessage(ActivityThread.java:1654)\r\n[WARN] : W/System.err: \tat android.os.Handler.dispatchMessage(Handler.java:105)\r\n[WARN] : W/System.err: \tat android.os.Looper.loop(Looper.java:164)\r\n[WARN] : W/System.err: \tat android.app.ActivityThread.main(ActivityThread.java:6541)\r\n[WARN] : W/System.err: \tat java.lang.reflect.Method.invoke(Native Method)\r\n[WARN] : W/System.err: \tat com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)\r\n[WARN] : W/System.err: \tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)\r\n{code}\r\n\r\n*Cause:*\r\nThe native view has been released and null-out when its parent window was closed. The above code's setters and methods should no-op in this case.\r\nNote that this is not an issue in Titanium versions older than 7.0.0.\r\n\r\n*Work-Around:*\r\nDon't call the ScrollableView's setters and methods once its parent window has been closed. For example, you don't need to set its child views to [] to release the child references since their references are already released automatically.\r\n", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-01-05T02:11:19.000+0000", "updated": "2018-01-05T02:11:19.000+0000" }, { "id": "432802", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/9696", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-01-06T02:52:48.000+0000", "updated": "2018-01-06T02:52:48.000+0000" }, { "id": "437351", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This issue is only reproducible in Titanium 7.0.0 and 7.0.1.\r\nThis issue is not reproducible in 7.0.2 and 7.1.0.\r\nIt was inadvertently fixed by a change in 7.0.2.\r\nClosing as resolved.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-05-03T23:50:02.000+0000", "updated": "2018-05-03T23:50:02.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }