Skip to content

iOS Lifecycle is destroyed for some reason only on certain devices when using camera. #185

Open
@cj3g10

Description

I have a problem that I need some assistance with, since I have no idea why this happens and my client isn't really being cooperative in assisting us debug this issue. I have a project that is using Decompose and iOS is using SwiftUI. The app is working fine for us, but when I gave this app to our client for UAT, one person is encountering a strange issue that I cannot replicate.
We have a screen where the user can select a picture or take a photo, and if they choose to take a photo, it will launch a new screen with a CameraView and the captured photo will be passed back to the 1st screen. This works fine for almost everyone, but for that one specific person's device, when they return to the first screen, none of the Component functions work.
Unfortunately debugging this has been hard because we do not have access to the only device that is reproducing this issue, and as mentioned, the client isn't exactly being cooperative and only tests it once a day at around midnight before they go to sleep. I've placed some logging in the app and what I find is that the Lifecycle inside the Component is in the Destroyed state upon returning to the first screen, which is why none of the Component's functions are responding as the coroutineScope is cancelled when the Lifecycle is destroyed. The Component's Lifecycle is not in the Destroyed state if the user does other actions such as using the photo picker, or going to an another screen and then returning back; it only specifically gets Destroyed after using the Camera.

Do you have any idea why the Lifecycle would get destroyed in this scenario? The device is an iPhone 11 using iOS 17.2, although I don't think this matters too much as we also tried with our own iPhone 11 using iOS 17.2.
How I can prevent this or alternatively is there anyway to restart the lifecycle?
Is there any more info you would like me to collect to help assist you?

Versions:
com.arkivanov.decompose:decompose:3.2.2
com.arkivanov.essenty:lifecycle:2.4.0

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions