Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19823] Android: ConcurrentModificationException at TiListView

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2015-11-12T02:27:33.000+0000
Affected Version/sn/a
Fix Version/sRelease 5.2.0
ComponentsAndroid
Labelsn/a
ReporterShuo Liang
AssigneeHieu Pham
Created2015-10-29T04:03:59.000+0000
Updated2015-11-25T22:53:58.000+0000

Description

Reproduce Step:

1. Simply the test case attached. 2. Scroll down until exception throw out and app crash.

Exception

[DEBUG] :  AndroidRuntime: Shutting down VM
[WARN] :   dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x40cbb930)
[ERROR] :  TiApplication: (main) [914474,914474] Sending event: exception on thread: main msg:java.util.ConcurrentModificationException; Titanium 5.0.0,2015/09/15 23:07,ec79bc5
[ERROR] :  TiApplication: java.util.ConcurrentModificationException
[ERROR] :  TiApplication: 	at java.util.ArrayList$ArrayListIterator.remove(ArrayList.java:582)
[ERROR] :  TiApplication: 	at ti.modules.titanium.ui.widget.listview.TiListView.checkMarker(TiListView.java:457)
[ERROR] :  TiApplication: 	at ti.modules.titanium.ui.widget.listview.TiListView$TiBaseAdapter.getView(TiListView.java:255)
[ERROR] :  TiApplication: 	at android.widget.HeaderViewListAdapter.getView(HeaderViewListAdapter.java:220)
[ERROR] :  TiApplication: 	at android.widget.AbsListView.obtainView(AbsListView.java:2143)
[ERROR] :  TiApplication: 	at android.widget.ListView.makeAndAddView(ListView.java:1831)
[ERROR] :  TiApplication: 	at android.widget.ListView.fillDown(ListView.java:674)
[ERROR] :  TiApplication: 	at android.widget.ListView.fillGap(ListView.java:638)
[ERROR] :  TiApplication: 	at android.widget.AbsListView.trackMotionScroll(AbsListView.java:4930)
[ERROR] :  TiApplication: 	at android.widget.AbsListView$FlingRunnable.run(AbsListView.java:4087)
[ERROR] :  TiApplication: 	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749)
[ERROR] :  TiApplication: 	at android.view.Choreographer.doCallbacks(Choreographer.java:562)
[ERROR] :  TiApplication: 	at android.view.Choreographer.doFrame(Choreographer.java:531)
[ERROR] :  TiApplication: 	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735)
[ERROR] :  TiApplication: 	at android.os.Handler.handleCallback(Handler.java:725)
[ERROR] :  TiApplication: 	at android.os.Handler.dispatchMessage(Handler.java:92)
[ERROR] :  TiApplication: 	at android.os.Looper.loop(Looper.java:137)
[ERROR] :  TiApplication: 	at android.app.ActivityThread.main(ActivityThread.java:5041)
[ERROR] :  TiApplication: 	at java.lang.reflect.Method.invokeNative(Native Method)
[ERROR] :  TiApplication: 	at java.lang.reflect.Method.invoke(Method.java:511)
[ERROR] :  TiApplication: 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
[ERROR] :  TiApplication: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
[ERROR] :  TiApplication: 	at dalvik.system.NativeStart.main(Native Method)

Note

1. It was working well in SDK 3.5.1.GA, but after upgrade to 5.0.x, it happened. 2. Basically test code is using ListView.setMarker() heavily to track which row the user has scrolled to and loading of additional rows. 3. Only happens on Android, iOS works well.

Attachments

FileDateSize
ListViewTest.zip2015-10-29T04:03:50.000+000037142

Comments

  1. Hieu Pham 2015-11-11

    master PR: https://github.com/appcelerator/titanium_mobile/pull/7426
  2. Ashraf Abu 2015-11-12

    Tested with ListViewTest.zip. PR merged.
  3. Lokesh Choudhary 2015-11-25

    Verified the fix. No errors & crash seen when scrolled continuously till the end. Closing. Environment: Appc Studio : 4.4.0.201511241829 Ti SDK : 5.2.0.v20151125112632 Ti CLI : 5.0.5 Alloy : 1.7.26 MAC Yosemite : 10.10.5 Appc NPM : 4.2.2 Appc CLI : 5.1.0 Node: v0.12.27 Nexus 6 - Android 6.0

JSON Source