Testflight auto update causing app crash

Hello, Our team are encountering a strange crash that seems to be occurring after the app is updated automatically through TestFlight. The crash is not easily reproducible and seems to be happening intermittently whenever a build is pushed out to TestFlight. We have determined that the app needs to be in the background when the auto-update occurs

From the logs it looks like TestFlight is killing the backgrounded app, installing the updated version and then trying to start it in the background. We have tried using appcenter to catch the exception but it seems like it won't allow any data to be written at the time which means we have struggled to collect logs for the issue. We have managed to collect some logs streamed from the device during the process if they are of any help as well.

Streamed logs:

Symbolicated Crash log

I'm having the same issue. Were you able to find a fix?

None yet, we are looking into various possibilities. I will post back here if we find a solution

Thank you! What a nightmare! I'm doing the same. I will post any solution here I could find.

So from what we have discovered, when testflight starts the app in the background after the auto update, The app is unable to access the filesystem and thus cannot read or write any of the files. For us this was causing a crash because we are using Akavache and starting it in one of the constructors of a service. When it tries to open the database when it gets resolved, it throws an exception and crashes. Until the app is back in the foreground none of the files can be accessed at all, we haven't figured out why, perhaps the files are protected in that state. To fix we restructured the code so Akavache was lazily started, and then when the app is opened we reset Akavache's cache so that it would start working again. What a nightmare of a bug!

Testflight auto update causing app crash
 
 
Q