CymChad / CymChad/BaseRecyclerViewAdapterHelper
BaseRecyclerViewAdapterHelper 使用 RecyclerView1.2.0 会出现java.lang.IllegalArgumentException
Open
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 24.6k
- Forks
- 5.2k
- PR merge metrics
- No merged PRs in 30d
Description
- 当前使用的版本号
3.0.4 使用 RecyclerView1.2.0 - 复现操作描述
- 使用代码
- crash日志
| 1 | java.lang.IllegalArgumentException: Called attach on a child which is not detached: BaseViewHolder |
|---|---|
| at androidx.recyclerview.widget.RecyclerView$5.attachViewToParent(SourceFile:4) |
at androidx.recyclerview.widget.ChildHelper.attachViewToParent(SourceFile:5)
at androidx.recyclerview.widget.RecyclerView$LayoutManager.addViewInt(SourceFile:20)
at androidx.recyclerview.widget.RecyclerView$LayoutManager.addView(SourceFile:2)
at androidx.recyclerview.widget.RecyclerView$LayoutManager.addView(SourceFile:1)
at com.google.android.flexbox.FlexboxLayoutManager.layoutFlexLineMainAxisHorizontal(SourceFile:25)
at com.google.android.flexbox.FlexboxLayoutManager.layoutFlexLine(SourceFile:2)
at com.google.android.flexbox.FlexboxLayoutManager.fill(SourceFile:12)
at com.google.android.flexbox.FlexboxLayoutManager.onLayoutChildren(SourceFile:23)
at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2(SourceFile:12)
at androidx.recyclerview.widget.RecyclerView.onMeasure(SourceFile:13)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the crash with BaseRecyclerViewAdapterHelper 3.0.4 and RecyclerView 1.2.0, using the stack trace through FlexboxLayoutManager as the entry point. Compare the adapter and RecyclerView behavior around the reported attach failure; done means the incompatible combination no longer raises this IllegalArgumentException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100