https://kotlinlang.org logo
#compose
Title
# compose
t

Tlaster

03/03/2021, 5:19 AM
Has anyone getting error
java.lang.IllegalArgumentException: 0 was already used with subcompose during this measuring pass
after beta01 when setting
initialFirstVisibleItemIndex
for LazyColumn? Full stacktrace in thread.
a

Albert Chang

03/03/2021, 5:23 AM
Are you using the same key for multiple items?
t

Tlaster

03/03/2021, 5:30 AM
Seems like it is the problem, thanks! I'm using Paging 3 with LazyColumn, and
LazyPagingItems.get
might return null if it is a placeholder, I might need to return a UUID instead of a
0
if it is a placeholder.
j

jim

03/03/2021, 2:35 PM
@Tlaster Can you file a bug? Mention what you did (duplicate key on LazyColumn), what error message you encountered (full stack trace) and that this error message was confusing.
cc @Andrey Kulikov
a

Andrey Kulikov

03/03/2021, 3:12 PM
you can also use index as a key for keys of placeholders. it just shouldn’t collide with real keys
t

Tlaster

03/04/2021, 2:10 AM
3 Views