CymChad / CymChad/BaseRecyclerViewAdapterHelper

BaseRecyclerViewAdapterHelper 使用 RecyclerView1.2.0 会出现java.lang.IllegalArgumentException

Open
#3,491 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Kotlin
Stars
24.6k
Forks
5.2k
PR merge metrics
No merged PRs in 30d

Description

  1. 当前使用的版本号
    3.0.4 使用 RecyclerView1.2.0
  2. 复现操作描述
  3. 使用代码
  4. 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.