apache / incubator-weex

Apache Weex (Incubating)
https://weex.apache.org
Apache License 2.0
13.74k stars 1.81k forks source link

[Android] RecyclerView, java.util.ConcurrentModificationException, weex v0.24.0 #2957

Open Rainbow-556 opened 5 years ago

Rainbow-556 commented 5 years ago

java.util.ConcurrentModificationException java.util.HashMap$HashIterator.nextNode(HashMap.java:1441)

2 java.util.HashMap$EntryIterator.next(HashMap.java:1475) 3 java.util.HashMap$EntryIterator.next(HashMap.java:1473) 4 com.taobao.weex.ui.component.WXComponent.updateProperties(WXComponent.java:699) 5 com.taobao.weex.ui.component.WXComponent.updateStyles(WXComponent.java:255) 6 com.taobao.weex.ui.component.WXComponent.bindData(WXComponent.java:652) 7 com.taobao.weex.ui.component.WXVContainer.bindData(WXVContainer.java:166) 8 com.taobao.weex.ui.component.WXVContainer.bindData(WXVContainer.java:166) 9 com.taobao.weex.ui.component.WXVContainer.bindData(WXVContainer.java:166) 10 com.taobao.weex.ui.view.listview.adapter.ListBaseViewHolder.bindData(ListBaseViewHolder.java:74) 11 com.taobao.weex.ui.component.list.BasicListComponent.onBindViewHolder(BasicListComponent.java:916) 12 com.taobao.weex.ui.component.list.BasicListComponent.onBindViewHolder(BasicListComponent.java:90) 13 com.taobao.weex.ui.view.listview.adapter.RecyclerViewBaseAdapter.onBindViewHolder(RecyclerViewBaseAdapter.java:70) 14 com.taobao.weex.ui.view.listview.adapter.RecyclerViewBaseAdapter.onBindViewHolder(RecyclerViewBaseAdapter.java:29) 15 android.support.v7.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:6673) 16 android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:6714) 17 android.support.v7.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:5647) 18 android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5913) 19 android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5752) 20 android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5748) 21 android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2232) 22 android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1559) 23 android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1519) 24 android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:614) 25 com.taobao.weex.ui.view.listview.ExtendedLinearLayoutManager.onLayoutChildren(ExtendedLinearLayoutManager.java:53) 26 android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3812) 27 android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:3529) 28 android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:4082) 29 android.view.View.layout(View.java:20699)

YorkShen commented 5 years ago

I knew this exception for a while.

Based on my knowledge, it happens by accident and the reason of this bug is mysterious even to me.

The best solution we have here is add some try catch in com.taobao.weex.ui.view.listview.adapter.RecyclerViewBaseAdapter.onBindViewHolder, could you please create PR then I can review your change.

I am a little busy these days, so please help yourself, then I will review and merge your PR.

Rainbow-556 commented 5 years ago

感谢解答,我先自己改项目依赖的weex源码吧,后续的weex版本更新时,你们修复这个就好了~

YorkShen commented 5 years ago

If it's possible, please give us a PR. We really need more incoming contributors, and I'd like to nomminate some of them to Weex committer.

fengqingyun2008 commented 4 years ago

请问这个bug修改了吗,我看最新的0.28版本的代码 com.taobao.weex.ui.view.listview.adapter.RecyclerViewBaseAdapter.onBindViewHolder 这里依然没有任何修改

YorkShen commented 4 years ago

@fengqingyun2008 Please give us a PR, thanks.

zhouxuemeng1988 commented 4 years ago

@fengqingyun2008 Please give us a PR, thanks.

https://github.com/zhouxuemeng1988/incubator-weex/tree/fix-issues-2957