{ "id": "104822", "key": "TIMOB-11893", "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": "14700", "description": "2012 Sprint 25", "name": "2012 Sprint 25", "archived": true, "released": true, "releaseDate": "2012-12-17" }, { "id": "14784", "description": "2012 Sprint 25 API", "name": "2012 Sprint 25 API", "archived": true, "released": true, "releaseDate": "2012-12-17" } ], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2012-12-04T22:04:45.000+0000", "created": "2012-11-12T08:38:46.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "android", "classname", "community", "exception", "tableView", "tableviewrow" ], "versions": [], "issuelinks": [], "assignee": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2013-03-13T15:03:20.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": "h6.Problem\r\nSeveral performance issues with tableview on Android. \r\n\r\nh6.Expected result\r\nApplying a classname attribute to all rows should solve these issues and so we did.\r\n\r\nh6.Actual results\r\nNow the app crashes continously but not at the same point each time we try.\r\n\r\nh6.Developer remarks\r\nUnfortunately we tried several things to avoid this issue \r\n* changed tableview's data creation to tableview.data = [row1,row2,...]; instead of creating an empty data array on tableview creation and add rows via appendRow();\r\n* removed startLayout() and finishLayout()\r\n* placed classname attribute at different possitions (seems to be important: classname in createTableViewRow({classname:...}) and the error occurs even earlier as if you place it as row.classname = ... somewhere after the creation part)\r\n\r\nSometimes the error occurs during TableView creation and sometimes during scrolling and sometimes it doesn't appear.\r\n\r\nh6.Stack Trace\r\n{noformat}\r\n[WARN][dalvikvm( 636)] threadid=1: thread exiting with uncaught exception (group=0x4001d800)\r\n[ERROR][TiApplication( 636)] (main) [1466163,1660888] Sending event: exception on thread: main msg:java.lang.ArrayIndexOutOfBoundsException; Titanium 2.1.3,2012/10/02 16:16,15997d0\r\n[ERROR][TiApplication( 636)] java.lang.ArrayIndexOutOfBoundsException\r\n[ERROR][TiApplication( 636)] \tat ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.applyChildProxies(TiTableViewRowProxyItem.java:164)\r\n[ERROR][TiApplication( 636)] \tat ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.refreshControls(TiTableViewRowProxyItem.java:144)\r\n[ERROR][TiApplication( 636)] \tat ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.setRowData(TiTableViewRowProxyItem.java:280)\r\n[ERROR][TiApplication( 636)] \tat ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.setRowData(TiTableViewRowProxyItem.java:83)\r\n[ERROR][TiApplication( 636)] \tat ti.modules.titanium.ui.widget.tableview.TiTableView$TTVListAdapter.getView(TiTableView.java:216)\r\n[ERROR][TiApplication( 636)] \tat android.widget.AbsListView.obtainView(AbsListView.java:1294)\r\n[ERROR][TiApplication( 636)] \tat android.widget.ListView.makeAndAddView(ListView.java:1727)\r\n[ERROR][TiApplication( 636)] \tat android.widget.ListView.fillDown(ListView.java:652)\r\n[ERROR][TiApplication( 636)] \tat android.widget.ListView.fillGap(ListView.java:623)\r\n[ERROR][TiApplication( 636)] \tat android.widget.AbsListView.trackMotionScroll(AbsListView.java:2944)\r\n[ERROR][TiApplication( 636)] \tat android.widget.AbsListView.onTouchEvent(AbsListView.java:2065)\r\n[ERROR][TiApplication( 636)] \tat android.widget.ListView.onTouchEvent(ListView.java:3315)\r\n[ERROR][TiApplication( 636)] \tat android.view.View.dispatchTouchEvent(View.java:3766)\r\n[ERROR][TiApplication( 636)] \tat android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:897)\r\n[ERROR][TiApplication( 636)] \tat android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)\r\n[ERROR][TiApplication( 636)] \tat android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)\r\n[ERROR][TiApplication( 636)] \tat android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)\r\n[ERROR][TiApplication( 636)] \tat android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)\r\n[ERROR][TiApplication( 636)] \tat android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)\r\n[ERROR][TiApplication( 636)] \tat android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)\r\n[ERROR][TiApplication( 636)] \tat android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)\r\n[ERROR][TiApplication( 636)] \tat com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1671)\r\n[ERROR][TiApplication( 636)] \tat com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)\r\n[ERROR][TiApplication( 636)] \tat android.app.Activity.dispatchTouchEvent(Activity.java:2086)\r\n[ERROR][TiApplication( 636)] \tat com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1655)\r\n[ERROR][TiApplication( 636)] \tat android.view.ViewRoot.handleMessage(ViewRoot.java:1785)\r\n[ERROR][TiApplication( 636)] \tat android.os.Handler.dispatchMessage(Handler.java:99)\r\n[ERROR][TiApplication( 636)] \tat android.os.Looper.loop(Looper.java:123)\r\n[ERROR][TiApplication( 636)] \tat android.app.ActivityThread.main(ActivityThread.java:4627)\r\n[ERROR][TiApplication( 636)] \tat java.lang.reflect.Method.invokeNative(Native Method)\r\n[ERROR][TiApplication( 636)] \tat java.lang.reflect.Method.invoke(Method.java:521)\r\n[ERROR][TiApplication( 636)] \tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)\r\n[ERROR][TiApplication( 636)] \tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)\r\n[ERROR][TiApplication( 636)] \tat dalvik.system.NativeStart.main(Native Method)\r\n[ERROR][AndroidRuntime( 636)] FATAL EXCEPTION: main\r\n[ERROR][AndroidRuntime( 636)] java.lang.ArrayIndexOutOfBoundsException\r\n[ERROR][AndroidRuntime( 636)] \tat ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.applyChildProxies(TiTableViewRowProxyItem.java:164)\r\n[ERROR][AndroidRuntime( 636)] \tat ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.refreshControls(TiTableViewRowProxyItem.java:144)\r\n[ERROR][AndroidRuntime( 636)] \tat ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.setRowData(TiTableViewRowProxyItem.java:280)\r\n[ERROR][AndroidRuntime( 636)] \tat ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.setRowData(TiTableViewRowProxyItem.java:83)\r\n[ERROR][AndroidRuntime( 636)] \tat ti.modules.titanium.ui.widget.tableview.TiTableView$TTVListAdapter.getView(TiTableView.java:216)\r\n[ERROR][AndroidRuntime( 636)] \tat android.widget.AbsListView.obtainView(AbsListView.java:1294)\r\n[ERROR][AndroidRuntime( 636)] \tat android.widget.ListView.makeAndAddView(ListView.java:1727)\r\n[ERROR][AndroidRuntime( 636)] \tat android.widget.ListView.fillDown(ListView.java:652)\r\n[ERROR][AndroidRuntime( 636)] \tat android.widget.ListView.fillGap(ListView.java:623)\r\n[ERROR][AndroidRuntime( 636)] \tat android.widget.AbsListView.trackMotionScroll(AbsListView.java:2944)\r\n[ERROR][AndroidRuntime( 636)] \tat android.widget.AbsListView.onTouchEvent(AbsListView.java:2065)\r\n[ERROR][AndroidRuntime( 636)] \tat android.widget.ListView.onTouchEvent(ListView.java:3315)\r\n[ERROR][AndroidRuntime( 636)] \tat android.view.View.dispatchTouchEvent(View.java:3766)\r\n[ERROR][AndroidRuntime( 636)] \tat android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:897)\r\n[ERROR][AndroidRuntime( 636)] \tat android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)\r\n[ERROR][AndroidRuntime( 636)] \tat android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)\r\n[ERROR][AndroidRuntime( 636)] \tat android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)\r\n[ERROR][AndroidRuntime( 636)] \tat android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)\r\n[ERROR][AndroidRuntime( 636)] \tat android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)\r\n[ERROR][AndroidRuntime( 636)] \tat android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)\r\n[ERROR][AndroidRuntime( 636)] \tat android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)\r\n[ERROR][AndroidRuntime( 636)] \tat com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1671)\r\n[ERROR][AndroidRuntime( 636)] \tat com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)\r\n[ERROR][AndroidRuntime( 636)] \tat android.app.Activity.dispatchTouchEvent(Activity.java:2086)\r\n[ERROR][AndroidRuntime( 636)] \tat com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1655)\r\n[ERROR][AndroidRuntime( 636)] \tat android.view.ViewRoot.handleMessage(ViewRoot.java:1785)\r\n[ERROR][AndroidRuntime( 636)] \tat android.os.Handler.dispatchMessage(Handler.java:99)\r\n[ERROR][AndroidRuntime( 636)] \tat android.os.Looper.loop(Looper.java:123)\r\n[ERROR][AndroidRuntime( 636)] \tat android.app.ActivityThread.main(ActivityThread.java:4627)\r\n[ERROR][AndroidRuntime( 636)] \tat java.lang.reflect.Method.invokeNative(Native Method)\r\n[ERROR][AndroidRuntime( 636)] \tat java.lang.reflect.Method.invoke(Method.java:521)\r\n[ERROR][AndroidRuntime( 636)] \tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)\r\n[ERROR][AndroidRuntime( 636)] \tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)\r\n[ERROR][AndroidRuntime( 636)] \tat dalvik.system.NativeStart.main(Native Method)\r\n{noformat}\r\n\r\nh6.Additional inputs\r\nI compared our version with the KitchenSink exmaples but i didn't find any important differences. Therefore I'm not able to create some code that reproduces this error but maybe the following code samples of our app may help you.\r\n\r\nh6.Repro sequence\r\nJust scroll down/up on a device to replicate\r\n{code:javascript}\r\nvar win = Titanium.UI.createWindow({\r\n title : 'Tab 2',\r\n backgroundColor : '#fff',\r\n width : Ti.UI.FILL,\r\n height : Ti.UI.FILL,\r\n exitOnClose : true,\r\n});\r\nvar tableView = Titanium.UI.createTableView({\r\n width : Ti.UI.FILL,\r\n height : Ti.UI.FILL\r\n});\r\n\r\nvar section = Ti.UI.createTableViewSection();\r\nfor (var i = 0; i < 100; i++) {\r\n var row = Ti.UI.createTableViewRow({\r\n className : 'row'//having this enabled, causes the issue\r\n });\r\n var view = Ti.UI.createView();\r\n view.add(Ti.UI.createLabel({\r\n text : '1',\r\n left : '10 dp'\r\n }));\r\n if (i % 2 === 0)\r\n view.add(Ti.UI.createLabel({\r\n text : '2',\r\n right : '10 dp',\r\n }));\r\n row.add(view);\r\n section.add(row);\r\n}\r\ntableView.data = [section];\r\n\r\nwin.add(tableView);\r\nwin.open();\r\n{code}\r\n\r\nh6.Stack trace - Razr 2.3.5\r\n{code}\r\n11-29 12:32:15.942: I/ActivityManager(499): Start proc com.appc.test for activity com.appc.test/._1bestpracticesActivity: pid=3412 uid=10148 gids={1015, 3003}\r\n11-29 12:32:15.997: I/TiApplication(3412): (main) [0,0] checkpoint, app created.\r\n11-29 12:32:16.036: I/TiApplication(3412): (main) [39,39] Titanium 2.1.3 (2012/10/02 16:16 15997d0)\r\n11-29 12:32:16.216: I/TiDbHelper(3412): (main) [182,221] No value in database for platform key: 'unique_machine_id' returning supplied default ''\r\n11-29 12:32:16.223: I/TiDbHelper(3412): (main) [4,225] No value in database for platform key: 'hardware_machine_id' returning supplied default ''\r\n11-29 12:32:16.294: I/TiApplication(3412): (main) [68,293] Titanium Javascript runtime: v8\r\n11-29 12:32:16.294: D/dalvikvm(3412): Trying to load lib /data/data/com.appc.test/lib/libstlport_shared.so 0x4051cd78\r\n11-29 12:32:16.302: D/dalvikvm(3412): Added shared lib /data/data/com.appc.test/lib/libstlport_shared.so 0x4051cd78\r\n11-29 12:32:16.302: D/dalvikvm(3412): No JNI_OnLoad found in /data/data/com.appc.test/lib/libstlport_shared.so 0x4051cd78, skipping init\r\n11-29 12:32:16.302: D/dalvikvm(3412): Trying to load lib /data/data/com.appc.test/lib/libkroll-v8.so 0x4051cd78\r\n11-29 12:32:16.309: D/dalvikvm(3412): Added shared lib /data/data/com.appc.test/lib/libkroll-v8.so 0x4051cd78\r\n11-29 12:32:16.333: I/TiRootActivity(3412): (main) [0,0] checkpoint, on root activity create, savedInstanceState: null\r\n11-29 12:32:16.387: D/TiAnalyticsDb(3412): (main) [59,59] Creating Database tianalytics.db\r\n11-29 12:32:16.387: I/TiAnalyticsDb(3412): (main) [1,60] Upgrading Database from 1 to 4\r\n11-29 12:32:16.528: E/TiApplication(3412): (KrollRuntimeThread) [135,195] APP PROXY: ti.modules.titanium.app.AppModule@405e5f90\r\n11-29 12:32:16.544: W/V8Object(3412): Runtime disposed, cannot set property 'userAgent'\r\n11-29 12:32:16.778: D/dalvikvm(3412): GC_EXTERNAL_ALLOC freed 1178K, 47% free 3786K/7111K, external 2741K/2773K, paused 36ms\r\n11-29 12:32:16.825: D/dalvikvm(3412): Trying to load lib /data/data/com.appc.test/lib/libtiverify.so 0x4051cd78\r\n11-29 12:32:16.825: D/dalvikvm(3412): Added shared lib /data/data/com.appc.test/lib/libtiverify.so 0x4051cd78\r\n11-29 12:32:16.825: I/TiRootActivity(3412): (main) [0,0] checkpoint, on root activity resume. activity = com.appc.test._1bestpracticesActivity@405bcd50\r\n11-29 12:32:16.911: W/InputManagerService(499): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@407d2688 (uid=10035 pid=917)\r\n11-29 12:32:16.919: I/gralloc(499): Allocated 0x660072 size 6488161\r\n11-29 12:32:16.973: I/ActivityManager(499): Displayed com.appc.test/._1bestpracticesActivity: +1s38ms\r\n11-29 12:32:17.052: I/ActivityManager(499): No longer want com.motorola.blur.home.other (pid 1999): hidden #21\r\n11-29 12:32:18.052: I/gralloc(499): Allocated 0x660072 size 6488161\r\n11-29 12:32:19.802: D/AndroidRuntime(3412): Shutting down VM\r\n11-29 12:32:19.802: W/dalvikvm(3412): threadid=1: thread exiting with uncaught exception (group=0x4001e560)\r\n11-29 12:32:19.848: E/TiApplication(3412): (main) [2976,2976] Sending event: exception on thread: main msg:java.lang.ArrayIndexOutOfBoundsException; Titanium 2.1.3,2012/10/02 16:16,15997d0\r\n11-29 12:32:19.848: E/TiApplication(3412): java.lang.ArrayIndexOutOfBoundsException\r\n11-29 12:32:19.848: E/TiApplication(3412): \tat ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.applyChildProxies(TiTableViewRowProxyItem.java:164)\r\n11-29 12:32:19.848: E/TiApplication(3412): \tat ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.refreshControls(TiTableViewRowProxyItem.java:144)\r\n11-29 12:32:19.848: E/TiApplication(3412): \tat ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.setRowData(TiTableViewRowProxyItem.java:280)\r\n11-29 12:32:19.848: E/TiApplication(3412): \tat ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.setRowData(TiTableViewRowProxyItem.java:83)\r\n11-29 12:32:19.848: E/TiApplication(3412): \tat ti.modules.titanium.ui.widget.tableview.TiTableView$TTVListAdapter.getView(TiTableView.java:216)\r\n11-29 12:32:19.848: E/TiApplication(3412): \tat android.widget.AbsListView.obtainView(AbsListView.java:1435)\r\n11-29 12:32:19.848: E/TiApplication(3412): \tat android.widget.ListView.makeAndAddView(ListView.java:1824)\r\n11-29 12:32:19.848: E/TiApplication(3412): \tat android.widget.ListView.fillDown(ListView.java:689)\r\n11-29 12:32:19.848: E/TiApplication(3412): \tat android.widget.ListView.fillGap(ListView.java:658)\r\n11-29 12:32:19.848: E/TiApplication(3412): \tat android.widget.AbsListView.trackMotionScroll(AbsListView.java:3469)\r\n11-29 12:32:19.848: E/TiApplication(3412): \tat android.widget.AbsListView.onTouchEvent(AbsListView.java:2276)\r\n11-29 12:32:19.848: E/TiApplication(3412): \tat android.widget.ListView.onTouchEvent(ListView.java:3535)\r\n11-29 12:32:19.848: E/TiApplication(3412): \tat android.view.View.dispatchTouchEvent(View.java:3885)\r\n11-29 12:32:19.848: E/TiApplication(3412): \tat android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:903)\r\n11-29 12:32:19.848: E/TiApplication(3412): \tat android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)\r\n11-29 12:32:19.848: E/TiApplication(3412): \tat android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)\r\n11-29 12:32:19.848: E/TiApplication(3412): \tat android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)\r\n11-29 12:32:19.848: E/TiApplication(3412): \tat android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)\r\n11-29 12:32:19.848: E/TiApplication(3412): \tat android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)\r\n11-29 12:32:19.848: E/TiApplication(3412): \tat android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)\r\n11-29 12:32:19.848: E/TiApplication(3412): \tat com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1921)\r\n11-29 12:32:19.848: E/TiApplication(3412): \tat com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1196)\r\n11-29 12:32:19.848: E/TiApplication(3412): \tat android.app.Activity.dispatchTouchEvent(Activity.java:2155)\r\n11-29 12:32:19.848: E/TiApplication(3412): \tat com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1905)\r\n11-29 12:32:19.848: E/TiApplication(3412): \tat android.view.ViewRoot.deliverPointerEvent(ViewRoot.java:2249)\r\n11-29 12:32:19.848: E/TiApplication(3412): \tat android.view.ViewRoot.handleMessage(ViewRoot.java:1933)\r\n11-29 12:32:19.848: E/TiApplication(3412): \tat android.os.Handler.dispatchMessage(Handler.java:99)\r\n11-29 12:32:19.848: E/TiApplication(3412): \tat android.os.Looper.loop(Looper.java:130)\r\n11-29 12:32:19.848: E/TiApplication(3412): \tat android.app.ActivityThread.main(ActivityThread.java:3859)\r\n11-29 12:32:19.848: E/TiApplication(3412): \tat java.lang.reflect.Method.invokeNative(Native Method)\r\n11-29 12:32:19.848: E/TiApplication(3412): \tat java.lang.reflect.Method.invoke(Method.java:507)\r\n11-29 12:32:19.848: E/TiApplication(3412): \tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:840)\r\n11-29 12:32:19.848: E/TiApplication(3412): \tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:598)\r\n11-29 12:32:19.848: E/TiApplication(3412): \tat dalvik.system.NativeStart.main(Native Method)\r\n11-29 12:32:19.927: E/AndroidRuntime(3412): FATAL EXCEPTION: main\r\n11-29 12:32:19.927: E/AndroidRuntime(3412): java.lang.ArrayIndexOutOfBoundsException\r\n11-29 12:32:19.927: E/AndroidRuntime(3412): \tat ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.applyChildProxies(TiTableViewRowProxyItem.java:164)\r\n11-29 12:32:19.927: E/AndroidRuntime(3412): \tat ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.refreshControls(TiTableViewRowProxyItem.java:144)\r\n11-29 12:32:19.927: E/AndroidRuntime(3412): \tat ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.setRowData(TiTableViewRowProxyItem.java:280)\r\n11-29 12:32:19.927: E/AndroidRuntime(3412): \tat ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.setRowData(TiTableViewRowProxyItem.java:83)\r\n11-29 12:32:19.927: E/AndroidRuntime(3412): \tat ti.modules.titanium.ui.widget.tableview.TiTableView$TTVListAdapter.getView(TiTableView.java:216)\r\n11-29 12:32:19.927: E/AndroidRuntime(3412): \tat android.widget.AbsListView.obtainView(AbsListView.java:1435)\r\n11-29 12:32:19.927: E/AndroidRuntime(3412): \tat android.widget.ListView.makeAndAddView(ListView.java:1824)\r\n11-29 12:32:19.927: E/AndroidRuntime(3412): \tat android.widget.ListView.fillDown(ListView.java:689)\r\n11-29 12:32:19.927: E/AndroidRuntime(3412): \tat android.widget.ListView.fillGap(ListView.java:658)\r\n11-29 12:32:19.927: E/AndroidRuntime(3412): \tat android.widget.AbsListView.trackMotionScroll(AbsListView.java:3469)\r\n11-29 12:32:19.927: E/AndroidRuntime(3412): \tat android.widget.AbsListView.onTouchEvent(AbsListView.java:2276)\r\n11-29 12:32:19.927: E/AndroidRuntime(3412): \tat android.widget.ListView.onTouchEvent(ListView.java:3535)\r\n11-29 12:32:19.927: E/AndroidRuntime(3412): \tat android.view.View.dispatchTouchEvent(View.java:3885)\r\n11-29 12:32:19.927: E/AndroidRuntime(3412): \tat android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:903)\r\n11-29 12:32:19.927: E/AndroidRuntime(3412): \tat android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)\r\n11-29 12:32:19.927: E/AndroidRuntime(3412): \tat android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)\r\n11-29 12:32:19.927: E/AndroidRuntime(3412): \tat android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)\r\n11-29 12:32:19.927: E/AndroidRuntime(3412): \tat android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)\r\n11-29 12:32:19.927: E/AndroidRuntime(3412): \tat android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)\r\n11-29 12:32:19.927: E/AndroidRuntime(3412): \tat android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:942)\r\n11-29 12:32:19.927: E/AndroidRuntime(3412): \tat com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1921)\r\n11-29 12:32:19.927: E/AndroidRuntime(3412): \tat com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1196)\r\n11-29 12:32:19.927: E/AndroidRuntime(3412): \tat android.app.Activity.dispatchTouchEvent(Activity.java:2155)\r\n11-29 12:32:19.927: E/AndroidRuntime(3412): \tat com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1905)\r\n11-29 12:32:19.927: E/AndroidRuntime(3412): \tat android.view.ViewRoot.deliverPointerEvent(ViewRoot.java:2249)\r\n11-29 12:32:19.927: E/AndroidRuntime(3412): \tat android.view.ViewRoot.handleMessage(ViewRoot.java:1933)\r\n11-29 12:32:19.927: E/AndroidRuntime(3412): \tat android.os.Handler.dispatchMessage(Handler.java:99)\r\n11-29 12:32:19.927: E/AndroidRuntime(3412): \tat android.os.Looper.loop(Looper.java:130)\r\n11-29 12:32:19.927: E/AndroidRuntime(3412): \tat android.app.ActivityThread.main(ActivityThread.java:3859)\r\n11-29 12:32:19.927: E/AndroidRuntime(3412): \tat java.lang.reflect.Method.invokeNative(Native Method)\r\n11-29 12:32:19.927: E/AndroidRuntime(3412): \tat java.lang.reflect.Method.invoke(Method.java:507)\r\n11-29 12:32:19.927: E/AndroidRuntime(3412): \tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:840)\r\n11-29 12:32:19.927: E/AndroidRuntime(3412): \tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:598)\r\n11-29 12:32:19.927: E/AndroidRuntime(3412): \tat dalvik.system.NativeStart.main(Native Method)\r\n11-29 12:32:19.958: W/ActivityManager(499): Force finishing activity com.appc.test/._1bestpracticesActivity\r\n11-29 12:32:20.106: D/dalvikvm(499): GC_EXTERNAL_ALLOC freed 1437K, 33% free 9328K/13767K, external 10097K/10227K, paused 90ms\r\n11-29 12:32:20.122: W/ApplicationContext(499): Unable to create files directory\r\n11-29 12:32:20.145: I/gralloc(499): Allocated 0x61663d64 size 2103800684\r\n11-29 12:32:20.458: W/ActivityManager(499): Activity pause timeout for HistoryRecord{40bf7d68 com.appc.test/._1bestpracticesActivity}\r\n11-29 12:32:20.505: D/ActivitityRenderTarget(917): onResume\r\n11-29 12:32:20.520: W/IMGSRV(917): eglglue.c:778: InitContext: ignoring buffer type CBUF_TYPE_PDS_VERT_SECONDARY_PREGEN_BUFFER\r\n11-29 12:32:20.528: I/gralloc(499): Allocated 0x660072 size 6488161\r\n11-29 12:32:20.645: I/gralloc(499): Allocated 0x660072 size 6488161\r\n11-29 12:32:20.716: I/gralloc(499): Allocated 0x660072 size 6488161\r\n11-29 12:32:20.731: I/gralloc(499): Allocated 0x660072 size 6488161\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: Applying className attribute to a Ti.UI.TableViewRow leads to an ArrayIndexOutOfBoundsException", "creator": { "name": "mrvvoo", "key": "mrvvoo", "displayName": "Markus Wutzler", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "mrvvoo", "key": "mrvvoo", "displayName": "Markus Wutzler", "active": true, "timeZone": "Europe/Berlin" }, "environment": "Titanium SDK 2.1.3 and 2.1.4.v20121030173408\r\nAndroid 2.2 Emulator\r\nHTC Desire 2.2.2\r\nDroid Razr 2.3.5", "comment": { "comments": [ { "id": "226976", "author": { "name": "mrvvoo", "key": "mrvvoo", "displayName": "Markus Wutzler", "active": true, "timeZone": "Europe/Berlin" }, "body": "Also other developers had similar issues: http://developer.appcelerator.com/question/123787/index-out-of-bound ; http://thompsonng.blogspot.de/2012/04/titanium-appcelerator-android-tableview.html\nBut just removing the classname attribute causes our app to slow down very hard.", "updateAuthor": { "name": "mrvvoo", "key": "mrvvoo", "displayName": "Markus Wutzler", "active": true, "timeZone": "Europe/Berlin" }, "created": "2012-11-12T08:49:48.000+0000", "updated": "2012-11-12T08:49:48.000+0000" }, { "id": "227449", "author": { "name": "mrvvoo", "key": "mrvvoo", "displayName": "Markus Wutzler", "active": true, "timeZone": "Europe/Berlin" }, "body": "We fixed that problem. It may not be a bug but it would be nice if this could be documented better:\r\nWhen two rows have the same className they not only need to have the same subviews but also their subviews need to have the same subviews.\r\nThe whole subview structure of a TableViewRow needs to be identical.\r\n\r\nThe last thing might be logical but there are a lot of developers getting stuck with this. So maybe this could be documented well because the error message is not very helpful but logical when you know the error.\r\n\r\nThanks!", "updateAuthor": { "name": "mrvvoo", "key": "mrvvoo", "displayName": "Markus Wutzler", "active": true, "timeZone": "Europe/Berlin" }, "created": "2012-11-15T13:58:40.000+0000", "updated": "2012-11-15T13:58:40.000+0000" }, { "id": "228311", "author": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "body": "@Markus Wutzler Can you please update this ticket with an actual sample?\n\nWith a 100% runnable script we could diagnose a potential bug fix in order to get it resolved.\n\nI've been trying to reproduce it as per target environment stated above, but afraid I've been absolutely unable to replicate what you posted earlier.\n\nBy using Kitchen Sink demos aren't accurate enough to narrow down this issue. Hope you can give us an update, the sooner the better. ", "updateAuthor": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-11-21T22:53:32.000+0000", "updated": "2012-11-21T22:53:32.000+0000" }, { "id": "228400", "author": { "name": "mrvvoo", "key": "mrvvoo", "displayName": "Markus Wutzler", "active": true, "timeZone": "Europe/Berlin" }, "body": "I can't provide a full sample but it is really simple:\r\n{code:javascript}\r\nvar section = Ti.UI.createTableViewSection();\r\nfor(var i = 0;i<100;i++){\r\nvar row = Ti.UI.createTableViewRow({\r\nclassName: 'row'\r\n});\r\nvar view = Ti.UI.createView();\r\nview.add(Ti.UI.createLabel({text: 'Hello!'}));\r\nif(i%2===0) view.add(Ti.UI.createImageView({image:'image.png'}));\r\nsection.add(row);\r\n}\r\ntableView.data = [section];\r\n{code}\r\nI didn't tried this but the error occurs even if the structure of child views is not the same.\r\nBug occurred on Android.\r\n\r\n// EDIT: Maybe i can try to create a complete sample, but this could take some time.", "updateAuthor": { "name": "mrvvoo", "key": "mrvvoo", "displayName": "Markus Wutzler", "active": true, "timeZone": "Europe/Berlin" }, "created": "2012-11-26T10:26:30.000+0000", "updated": "2012-11-28T16:53:11.000+0000" }, { "id": "228422", "author": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "body": "@Markus Thanks for get back to this ticket, unfortunately I'm not quite sure to understand the latest snippet code posted by you. What it means \"/Insert some random here/\" on line 8?\r\n\r\nCan you go the following repo and test some [tableViews samples here|https://github.com/appcelerator/KitchenSink/tree/master/Resources/ui/common/baseui/table_*.js]\r\n\r\nHopefully, it will replicate the problem and narrow down the *ArrayIndexOutOfBoundsException*\r\n\r\nEdit: Got another error, *tableView* is not even set at the latest sample. You might want to have a look at this guide about [Creating a Test Case|http://docs.appcelerator.com/titanium/latest/#!/guide/How_to_Submit_a_Bug_Report-section-29004732_HowtoSubmitaBugReport-CreatingaTestCase]. Will reopen this ticket when a working sample got provided.", "updateAuthor": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-11-26T16:20:29.000+0000", "updated": "2012-11-28T17:02:28.000+0000" }, { "id": "228831", "author": { "name": "mrvvoo", "key": "mrvvoo", "displayName": "Markus Wutzler", "active": true, "timeZone": "Europe/Berlin" }, "body": "Okay, i edited my code snippet. now it should reproduce the error.\nThe problem ist that every second list item diverges from the other one although each list item contains one view. but this view contains only one item on one view and two items on the next view. so the view structure is equal on the first level of the hierarchy but on the second level the view structure of all list items is not equal anymore.", "updateAuthor": { "name": "mrvvoo", "key": "mrvvoo", "displayName": "Markus Wutzler", "active": true, "timeZone": "Europe/Berlin" }, "created": "2012-11-28T16:56:44.000+0000", "updated": "2012-11-28T16:56:44.000+0000" }, { "id": "229038", "author": { "name": "mrvvoo", "key": "mrvvoo", "displayName": "Markus Wutzler", "active": true, "timeZone": "Europe/Berlin" }, "body": "{code:javascript}\nvar win = Titanium.UI.createWindow({\n title : 'Tab 2',\n backgroundColor : '#fff',\n width : Ti.UI.FILL,\n height : Ti.UI.FILL,\n exitOnClose : true,\n});\nvar tableView = Titanium.UI.createTableView({\n width : Ti.UI.FILL,\n height : Ti.UI.FILL\n});\n\nvar section = Ti.UI.createTableViewSection();\nfor (var i = 0; i < 100; i++) {\n var row = Ti.UI.createTableViewRow({\n className : 'row'\n });\n var view = Ti.UI.createView();\n view.add(Ti.UI.createLabel({\n text : '1',\n left : '10 dp'\n }));\n if (i % 2 === 0)\n view.add(Ti.UI.createLabel({\n text : '2',\n right : '10 dp',\n }));\n row.add(view);\n section.add(row);\n}\ntableView.data = [section];\n\nwin.add(tableView);\nwin.open(); \n{code}\nThis is the full sample that leads to the error. at least when you try to scroll on a device. As you see the subview structure is different on every second row although each row contains only a single view as first children.\n\nThis might be logical in this small example but in a more complex exampl you loose overview very fast and this problem is nowhere documented.", "updateAuthor": { "name": "mrvvoo", "key": "mrvvoo", "displayName": "Markus Wutzler", "active": true, "timeZone": "Europe/Berlin" }, "created": "2012-11-29T14:27:14.000+0000", "updated": "2012-11-29T14:27:14.000+0000" }, { "id": "229080", "author": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "body": "@Markuz Thanks for providing a simple sample reproducing the problem. I was able to replicate on device. Notice that in the meantime the ticket was moved to Main Titanium project to dig into it.", "updateAuthor": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-11-29T18:51:25.000+0000", "updated": "2012-11-29T18:51:25.000+0000" }, { "id": "229953", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "See http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.UI.TableViewRow-property-className\n\nA table view row must have a unique class name if the row layout is unique.\n\nYou have two different view structures according to your example. So you need two different class names", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-12-04T22:04:32.000+0000", "updated": "2012-12-04T22:04:32.000+0000" }, { "id": "240518", "author": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "body": "As per the documentation,given test app is invalid.So closing the bug.", "updateAuthor": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-04T10:59:37.000+0000", "updated": "2013-03-04T10:59:37.000+0000" } ], "maxResults": 11, "total": 11, "startAt": 0 } } }