nextcloud / android

📱 Nextcloud Android app
https://play.google.com/store/apps/details?id=com.nextcloud.client
GNU General Public License v2.0
4.26k stars 1.76k forks source link

Crash while viewing (and downloading) media (in the background) #12760

Closed rugk closed 5 months ago

rugk commented 7 months ago

⚠️ Before posting ⚠️

Steps to reproduce

Dunno, I just swiped some screen.

Expected behaviour

Not crash

Actual behaviour

Crashed and the report dialog let me here

Android version

14

Device brand and model

Fairphone 4 (FP4)

Stock or custom OS?

Custom (explain in "additional information")

Nextcloud android app version

3.28.0

Nextcloud server version

dunno

Using a reverse proxy?

Yes

Android logs

Cause of error

Exception in thread "main" java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
    at androidx.fragment.app.FragmentManager.checkStateLoss(FragmentManager.java:1632)
    at androidx.fragment.app.FragmentManager.enqueueAction(FragmentManager.java:1672)
    at androidx.fragment.app.BackStackRecord.commitInternal(BackStackRecord.java:341)
    at androidx.fragment.app.BackStackRecord.commit(BackStackRecord.java:306)
    at androidx.fragment.app.DialogFragment.show(DialogFragment.java:524)
    at com.owncloud.android.ui.activity.FileActivity.showLoadingDialog(FileActivity.java:556)
    at com.owncloud.android.ui.helpers.FileOperationsHelper.lambda$syncFile$1(FileOperationsHelper.java:254)
    at com.owncloud.android.ui.helpers.FileOperationsHelper.$r8$lambda$4uYT9xe-AzaengRJid_wcYy-yTI(Unknown Source:0)
    at com.owncloud.android.ui.helpers.FileOperationsHelper$$ExternalSyntheticLambda4.run(Unknown Source:2)
    at android.os.Handler.handleCallback(Handler.java:958)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loopOnce(Looper.java:205)
    at android.os.Looper.loop(Looper.java:294)
    at android.app.ActivityThread.main(ActivityThread.java:8248)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)

App information

Device information

Firmware

Server error logs

No response

Additional information

OS: Android 14, CalyxOS 5.4.1
source: F-Droid
Build-ID: UQ1A.240205.004.24504010

rugk commented 7 months ago

After the issue started, I restarted nextcloud and opened an image. In the background the download may still be triggered.

After some crashes and restarts, it starts in the main folder and maybe also stopped the download?

alperozturk96 commented 6 months ago

@rugk Could you try with this PR?

rugk commented 4 months ago

It's hard to reproduce so well, but thanks for fixing!