Status Update
Comments
jo...@google.com <jo...@google.com> #2
I'm seeing this as well, and it's happening after navigating to a screen that does not even use compose dependencies. Our flow is:
Non Compose fragment -> Compose fragment -> Non compose fragment -> This crash immediately
Currently troubleshooting, but coming up empty and cannot reproduce on my device, but seeing crashes on client devices.
Non Compose fragment -> Compose fragment -> Non compose fragment -> This crash immediately
Currently troubleshooting, but coming up empty and cannot reproduce on my device, but seeing crashes on client devices.
[Deleted User] <[Deleted User]> #3
What devices and API levels are you seeing this issue?
jo...@google.com <jo...@google.com> #4
Compose version: 1.2.1
Devices: Various devices, seen across Samsung/Pixels/Moto/etc.
Device API levels: Seen on Android 8-13
Devices: Various devices, seen across Samsung/Pixels/Moto/etc.
Device API levels: Seen on Android 8-13
Description
Version used: 1.0.0-alpha04
Devices/Android versions reproduced on: emulator API 28
Create a new BiometricPrompt and call authenticate, a new BiometricFragment is created and added to the FragmentManager. Dismiss this BiometricPrompt.
Create a new BiometricPrompt and call authenticate, a new BiometricFragment is created but before being displayed findFragmentByTag(BIOMETRIC_FRAGMENT_TAG) is called on the FragmentManager. Because the previous BiometricFragment was only detached and not removed this returns true and instead of the new BiometricFragment being added it is instead attached. This results in the previous BiometricFragment leaking (it is still added to the FragmentManager but a new BiometricFragment has been created) and the new BiometricFragment is not displayed (attach is called without the Fragment being added therefore it is not displayed).
A fix could be to make the check to findFragmentByTag(BIOMETRIC_FRAGMENT_TAG) before creating a new BiometricFragment, and just acquire the reference to the previously created BiometricFragment instead of creating a new instance.