Status Update
Comments
rh...@gmail.com <rh...@gmail.com> #2
I'm getting the same error today
ve...@gmail.com <ve...@gmail.com> #3
Any chance you could provide a way to repro this crash?
as...@google.com <as...@google.com> #4
Andrey, could you verify if this is the same root cause as
BTW, the question in #3 was meant for folks who made
ve...@gmail.com <ve...@gmail.com> #5
deleted
Description
Jetpack Compose version: at least 1.2.0 - 1.4.0-alpha03
Jetpack Compose component(s) used: -
Android Studio Build: 2022.1.1 rc3 - 2022.2.1 Canary 11
Kotlin version: at least 1.7.20 - 1.7.21
Application consists from 3 activities. MainActivity, IntermediateActivity, ComposeActivity MainActivity was added Fragment which has basic Compose UI.
MainActivity is first activity
Fragment is added to MainActivity:
Second activity: IntermediateActivity
Third activity which leaks just compose activity with basic UI: ComposeActivity
Steps:
Main part here is in MyFragment
fragmentWasHidden state triggers recomposition last time, when Fragment already hiding. This somehow effects all compose views further ahead even separate activities.
As many times we returned from ComposeActivity to IntermediateActivities, so many leaked ComposeActivity we can have. We can verify with profiler. I'm attaching the demo project and heap dump.
When we return back to MainActivity. All instances of Compose Activities will be magically wiped out.
The request is to provide at least some workaround for it until proper fix, because I wasn't able to find any solution to this.
Reproducibility - 100%