thunderbird / thunderbird-android

Thunderbird for Android – Open Source Email App for Android (fka K-9 Mail)
https://thunderbird.net/
Apache License 2.0
10.06k stars 2.47k forks source link

save an attachment k9-mail crashes #7160

Open He-Zu opened 1 year ago

He-Zu commented 1 year ago

Checklist

App version

6.710

Where did you get the app from?

F-Droid

Android version

Android 8

Device model

Shift Phone 5me

Steps to reproduce

save attachment

Expected behavior

crashes

Actual behavior

Hello, when I want to save an attachment k9-mail crashes. It doesn't matter what kind of attachment. The attachment is not saved.

Shift Phone 5 Android 8 K9-mail v 6.710

Is there a solution or workaraound

Thanks

Logs

no

He-Zu commented 1 year ago

ADDITIONAL NOTE: with the last version of the old gui interface (v. 5.6) saving attachments is possible without any problems

ByteHamster commented 1 year ago

My guess would be that you disabled/removed the system's file picker app. Did you disable any system apps?

He-Zu commented 1 year ago

Hello, thank you for the answer Unfortunately this is not the case. System App "Files" is not disabled. No other System Apps are disabled. Mixplorer is also still available to save attachments. no matter which app I choose k-9 crashes. I have seen that the attachment is then with 0 bytes in the selected folder. Is this some kind of permission problem? And as I said with the last version with the old gui the saving still works. Thanks for the help

ByteHamster commented 1 year ago

Then I guess a log export would be needed: https://github.com/thundernest/k-9/wiki/LoggingErrors

He-Zu commented 1 year ago

hello here is the log. hope it is helpful thanks k9mail-logs.txt

cketti commented 1 year ago

The problem seems to be that K-9 Mail is removed from memory while the system displays the screen to select an attachment location and name. K-9 Mail doesn't properly save its state. And by the time it is relaunched by the system, the app has forgotten which attachment the user has clicked. That leads to the crash.

Fixing this bug is not trivial and requires some architectural changes.

All that being said, users should rarely run into this issue. Most devices have enough RAM so the app that was just in the foreground (and will be again soon) isn't killed due to the system needing more memory. Did you maybe enable Android's developer options and have "Don't keep activities" enabled? Or do you use some form of very aggressive "battery optimization" that kills apps as soon as they move to the background?

ByteHamster commented 1 year ago

I have reports by some AntennaPod users with a similar background state saving problem. They didn't change the developer setting. The one in a recent issue was on Android 7 but the user didn't fill in the device model. I haven't asked about other battery optimization stuff, but I wouldn't be surprised if some vendors did weird stuff there

He-Zu commented 1 year ago

Hello all, perfect it works. i turned off "Don't keep activities" in the developer options. Now mail attachments can be saved without problems. Thank you very much for your help