{ "id": "146817", "key": "TIMOB-18824", "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": "16723", "description": "Windows Platform Support, ListView updates, Vector overlays in maps", "name": "Release 4.1.0", "archived": false, "released": true, "releaseDate": "2015-07-08" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2015-05-13T07:42:14.000+0000", "created": "2015-04-10T21:05:31.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "android", "crash", "listview" ], "versions": [], "issuelinks": [], "assignee": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "updated": "2015-06-04T01:17:57.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": [], "description": "ListView is crashing when reaching the end of the list. This same test case works without crashing with Ti SDK 4.0.0.Beta2.\r\n\r\nSteps to reproduce:\r\n\r\n# Load code below with Ti SDK 4.1.0.v20150410061234\r\n# Tap the \"Append 10 items\" button\r\n# Scroll all the way to the bottom\r\n# Observer app crash\r\n\r\nTest case:\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor : \"#ffffff\",\r\n\tlayout : \"absolute\"\r\n});\r\n\r\nwin.open();\r\n\r\nvar appendButton = Ti.UI.createButton({\r\n\ttitle : \"Append 10 items\",\r\n\theight : \"10%\",\r\n\ttop : \"5%\"\r\n});\r\n\r\nappendButton.addEventListener(\"click\", function() {\r\n\tappendData();\r\n});\r\n\r\nwin.add(appendButton);\r\n\r\nvar screenWidth = Ti.Platform.displayCaps.platformWidth;\r\n\r\nvar listSection = Ti.UI.createListSection();\r\n\r\nvar listView = Ti.UI.createListView({\r\n\tbackgroundColor : \"#cccccc\",\r\n\ttop : \"20%\",\r\n\theight : \"80%\",\r\n\ttemplates : {\r\n\t\t\"photoWithCaption\" : {\r\n\t\t\tproperties : {\r\n\t\t\t\tlayout : \"vertical\",\r\n\t\t\t\theight : Ti.UI.SIZE\r\n\t\t\t},\r\n\t\t\tchildTemplates : [{\r\n\t\t\t\ttype : \"Ti.UI.ImageView\",\r\n\t\t\t\tbindId : \"photo\",\r\n\t\t\t\tproperties : {\r\n\t\t\t\t\theight : screenWidth,\r\n\t\t\t\t\twidth : screenWidth,\r\n\t\t\t\t\tpreventDefaultImage : true\r\n\t\t\t\t}\r\n\t\t\t}, {\r\n\t\t\t\ttype : \"Ti.UI.TextArea\",\r\n\t\t\t\tbindId : \"caption\",\r\n\t\t\t\tproperties : {\r\n\t\t\t\t\tbackgroundColor : \"#ffffff\",\r\n\t\t\t\t\theight : Ti.UI.SIZE,\r\n\t\t\t\t\tleft : 10,\r\n\t\t\t\t\tright : 10,\r\n\t\t\t\t\teditable : false,\r\n\t\t\t\t\tscrollable : false\r\n\t\t\t\t}\r\n\t\t\t}]\r\n\t\t}\r\n\t},\r\n\tdefaultItemTemplate : \"photoWithCaption\"\r\n});\r\n\r\nlistView.setSections([listSection]);\r\n\r\nwin.add(listView);\r\n\r\nfunction appendData() {\r\n\tvar data = [];\r\n\r\n\tfor (var i = 0; i < 10; i++) {\r\n\t\tvar text = \"This a caption #\" + (i + 1) + \", and it may disappear when an append of new data happens on the parent ListView.\";\r\n\r\n\t\tdata.push({\r\n\t\t\ttemplate : \"photoWithCaption\",\r\n\t\t\tphoto : {\r\n\t\t\t\timage : \"http://thecatapi.com/api/images/get?format=src&type=jpg&size=small\"\r\n\t\t\t},\r\n\t\t\tcaption : {\r\n\t\t\t\tattributedString : Titanium.UI.createAttributedString({\r\n\t\t\t\t\ttext : text,\r\n\t\t\t\t\tattributes : [{\r\n\t\t\t\t\t\ttype : Ti.UI.ATTRIBUTE_FONT,\r\n\t\t\t\t\t\tvalue : {\r\n\t\t\t\t\t\t\tfont : {\r\n\t\t\t\t\t\t\t\tfontSize : 14\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\trange : [0, text.length]\r\n\t\t\t\t\t}, {\r\n\t\t\t\t\t\ttype : Ti.UI.ATTRIBUTE_FOREGROUND_COLOR,\r\n\t\t\t\t\t\tvalue : \"#000000\",\r\n\t\t\t\t\t\trange : [0, text.length]\r\n\t\t\t\t\t}]\r\n\t\t\t\t})\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tlistSection.appendItems(data);\r\n}\r\n{code}\r\n\r\nStack trace:\r\n{code}\r\n04-10 13:52:35.211: E/TiApplication(19289): (main) [30186,32990] Sending event: exception on thread: main msg:java.lang.NullPointerException: Attempt to read from field 'java.lang.Object android.util.Pair.second' on a null object reference; Titanium 4.1.0,2015/04/10 06:13,29ba994\r\n04-10 13:52:35.211: E/TiApplication(19289): java.lang.NullPointerException: Attempt to read from field 'java.lang.Object android.util.Pair.second' on a null object reference\r\n04-10 13:52:35.211: E/TiApplication(19289): \tat ti.modules.titanium.ui.widget.listview.TiListView$1.onScrollStateChanged(TiListView.java:337)\r\n04-10 13:52:35.211: E/TiApplication(19289): \tat android.widget.AbsListView.reportScrollStateChange(AbsListView.java:4335)\r\n04-10 13:52:35.211: E/TiApplication(19289): \tat android.widget.AbsListView$FlingRunnable.endFling(AbsListView.java:4466)\r\n04-10 13:52:35.211: E/TiApplication(19289): \tat android.widget.AbsListView$FlingRunnable.run(AbsListView.java:4601)\r\n04-10 13:52:35.211: E/TiApplication(19289): \tat android.view.Choreographer$CallbackRecord.run(Choreographer.java:767)\r\n04-10 13:52:35.211: E/TiApplication(19289): \tat android.view.Choreographer.doCallbacks(Choreographer.java:580)\r\n04-10 13:52:35.211: E/TiApplication(19289): \tat android.view.Choreographer.doFrame(Choreographer.java:549)\r\n04-10 13:52:35.211: E/TiApplication(19289): \tat android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753)\r\n04-10 13:52:35.211: E/TiApplication(19289): \tat android.os.Handler.handleCallback(Handler.java:739)\r\n04-10 13:52:35.211: E/TiApplication(19289): \tat android.os.Handler.dispatchMessage(Handler.java:95)\r\n04-10 13:52:35.211: E/TiApplication(19289): \tat android.os.Looper.loop(Looper.java:135)\r\n04-10 13:52:35.211: E/TiApplication(19289): \tat android.app.ActivityThread.main(ActivityThread.java:5254)\r\n04-10 13:52:35.211: E/TiApplication(19289): \tat java.lang.reflect.Method.invoke(Native Method)\r\n04-10 13:52:35.211: E/TiApplication(19289): \tat java.lang.reflect.Method.invoke(Method.java:372)\r\n04-10 13:52:35.211: E/TiApplication(19289): \tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)\r\n04-10 13:52:35.211: E/TiApplication(19289): \tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)\r\n04-10 13:52:35.234: E/AndroidRuntime(19289): FATAL EXCEPTION: main\r\n04-10 13:52:35.234: E/AndroidRuntime(19289): Process: blah, PID: 19289\r\n04-10 13:52:35.234: E/AndroidRuntime(19289): java.lang.NullPointerException: Attempt to read from field 'java.lang.Object android.util.Pair.second' on a null object reference\r\n04-10 13:52:35.234: E/AndroidRuntime(19289): \tat ti.modules.titanium.ui.widget.listview.TiListView$1.onScrollStateChanged(TiListView.java:337)\r\n04-10 13:52:35.234: E/AndroidRuntime(19289): \tat android.widget.AbsListView.reportScrollStateChange(AbsListView.java:4335)\r\n04-10 13:52:35.234: E/AndroidRuntime(19289): \tat android.widget.AbsListView$FlingRunnable.endFling(AbsListView.java:4466)\r\n04-10 13:52:35.234: E/AndroidRuntime(19289): \tat android.widget.AbsListView$FlingRunnable.run(AbsListView.java:4601)\r\n04-10 13:52:35.234: E/AndroidRuntime(19289): \tat android.view.Choreographer$CallbackRecord.run(Choreographer.java:767)\r\n04-10 13:52:35.234: E/AndroidRuntime(19289): \tat android.view.Choreographer.doCallbacks(Choreographer.java:580)\r\n04-10 13:52:35.234: E/AndroidRuntime(19289): \tat android.view.Choreographer.doFrame(Choreographer.java:549)\r\n04-10 13:52:35.234: E/AndroidRuntime(19289): \tat android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753)\r\n04-10 13:52:35.234: E/AndroidRuntime(19289): \tat android.os.Handler.handleCallback(Handler.java:739)\r\n04-10 13:52:35.234: E/AndroidRuntime(19289): \tat android.os.Handler.dispatchMessage(Handler.java:95)\r\n04-10 13:52:35.234: E/AndroidRuntime(19289): \tat android.os.Looper.loop(Looper.java:135)\r\n04-10 13:52:35.234: E/AndroidRuntime(19289): \tat android.app.ActivityThread.main(ActivityThread.java:5254)\r\n04-10 13:52:35.234: E/AndroidRuntime(19289): \tat java.lang.reflect.Method.invoke(Native Method)\r\n04-10 13:52:35.234: E/AndroidRuntime(19289): \tat java.lang.reflect.Method.invoke(Method.java:372)\r\n04-10 13:52:35.234: E/AndroidRuntime(19289): \tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)\r\n04-10 13:52:35.234: E/AndroidRuntime(19289): \tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: ListView crashes app when scrolled to end of list", "creator": { "name": "athorne", "key": "athorne", "displayName": "Alex Bernier", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "athorne", "key": "athorne", "displayName": "Alex Bernier", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Appc Studio: 4.0.0.201504021909\r\nTi SDK: 4.1.0.v20150410061234\r\nCLI: 4.0.0-beta3\r\nMAC: 10.9.5\r\nDevice: Nexus 6 - android 5.1", "closedSprints": [ { "id": 404, "state": "closed", "name": "2015 Sprint 10 SDK", "startDate": "2015-05-09T00:00:53.391Z", "endDate": "2015-05-23T00:00:00.000Z", "completeDate": "2015-05-25T14:55:16.386Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "349258", "author": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "body": "So your test case works with 4.0.0 SDK but not with 4.1.0 SDK? Note that 4.1.0 SDK is a a CI build and not supported officially.", "updateAuthor": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-04-13T03:31:10.000+0000", "updated": "2015-04-13T03:31:10.000+0000" }, { "id": "349259", "author": { "name": "athorne", "key": "athorne", "displayName": "Alex Bernier", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~ngupta] You got it; works in 4.0.0.Beta2. So, maybe this ticket isn't important at the moment, but I noticed it and had a test case ready for another ticket, so I just filed it.", "updateAuthor": { "name": "athorne", "key": "athorne", "displayName": "Alex Bernier", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-04-13T03:42:53.000+0000", "updated": "2015-04-13T03:42:53.000+0000" }, { "id": "349264", "author": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Thank you for filing this issue. We would definitely look at it but it is not the high priority right now.", "updateAuthor": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-04-13T03:56:59.000+0000", "updated": "2015-04-13T03:56:59.000+0000" }, { "id": "349265", "author": { "name": "athorne", "key": "athorne", "displayName": "Alex Bernier", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Agreed, and no problemo. Good luck with the release! 4.0.0 looks great.", "updateAuthor": { "name": "athorne", "key": "athorne", "displayName": "Alex Bernier", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-04-13T04:00:43.000+0000", "updated": "2015-04-13T04:00:43.000+0000" }, { "id": "352215", "author": { "name": "athorne", "key": "athorne", "displayName": "Alex Bernier", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Submitted a pull request for this. Tested on Nexus 6.", "updateAuthor": { "name": "athorne", "key": "athorne", "displayName": "Alex Bernier", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-05-12T01:07:15.000+0000", "updated": "2015-05-12T01:07:15.000+0000" }, { "id": "352219", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/6837", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-05-12T02:13:04.000+0000", "updated": "2015-05-12T02:13:04.000+0000" }, { "id": "352410", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "[~abernier] PR accepted and merged. Thank you!", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2015-05-13T07:43:00.000+0000", "updated": "2015-05-13T07:43:00.000+0000" }, { "id": "352431", "author": { "name": "athorne", "key": "athorne", "displayName": "Alex Bernier", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Great news! Thank you!", "updateAuthor": { "name": "athorne", "key": "athorne", "displayName": "Alex Bernier", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-05-13T14:29:59.000+0000", "updated": "2015-05-13T14:29:59.000+0000" }, { "id": "354306", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix.\r\nThe listview does not crash the app .\r\n\r\nClosing.\r\n\r\nEnvironment:\r\nAppc Studio : 4.1.0.201505071004\r\nTi SDK : 4.1.0.v20150602140423\r\nCLI : 4.0.1\r\nAlloy : 1.6.0\r\nMAC Yosemite : 10.10.3\r\nAppc npm : 4.0.0\r\nAppc CLI : 4.0.1\r\nNode: v0.10.37\r\nNexus 5 - Android 5.1.1\r\n", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-06-04T01:17:42.000+0000", "updated": "2015-06-04T01:17:42.000+0000" } ], "maxResults": 9, "total": 9, "startAt": 0 } } }