Status Update
Comments
ha...@reddit.com <ha...@reddit.com> #2
Your test is configured to run as a Junit test using Roboelectric.
The work-testing artifact only supports android instrumentation tests. For more information please take a look at:https://github.com/googlesamples/android-architecture-components/blob/master/WorkManagerSample/app/build.gradle#L64
The work-testing artifact only supports android instrumentation tests. For more information please take a look at:
ma...@google.com <ma...@google.com> #3
Hi,
thanks for your answer. I believe this has changed in the last version? as until 1.0.0-alpha11 it was possible to run a Worker in Junit test with Robolectric.
thanks for your answer. I believe this has changed in the last version? as until 1.0.0-alpha11 it was possible to run a Worker in Junit test with Robolectric.
ry...@google.com <ry...@google.com> #5
This has been addressed in RecyclerView 1.3.1-rc01; please let us know if it's still happening.
ha...@reddit.com <ha...@reddit.com> #6
I can confirm this is fixed in RecyclerView 1.3.1-rc01. Thanks a lot!
Description
Steps to Reproduce or Code Sample to Reproduce:
See MainActivity in attached sample project, or:
Note: RV refers to
RecyclerView
RecyclerView
RecyclerView
are emptyFrameLayout
sonBindViewHolder
of the RV adapter, createComposeView
and add it as a child to theFrameLayout
. CallsetContent
on theComposeView
with arbitrary layout (e.g. coloredBox
)notifyItemChanged(0, Any())
Behavior:
What I would expect to happen: No crash happens
What actually happens:
onBindViewHolder
call, theparent
field of theRecyclerView
item view will benull
, but itsmAttachInfo
will not benull
ComposeView
is added to the item view, itsisAttachedToWindow
will be true, and it will try to create a composition.ViewTreeLifecycleOwner
usingView.findViewTreeLifecycleOwner()
which tries walking up the view hierarchy to obtain the owner from the root view.parent
,View.findViewTreeLifecycleOwner()
returns null, andView.createLifecycleAwareWindowRecomposer()
throws and crashes the app.Stack trace (if applicable):