nextcloud / android

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

Exception while scrolling through photos: `IllegalStateException: Fragment already added: PreviewImageFragment` #10494

Open mjholub opened 2 years ago

mjholub commented 2 years ago

Cause of error

Exception in thread "main" java.lang.IllegalStateException: Fragment already added: PreviewImageFragment{e0ecdb2} (e31d9a73-056a-435c-bd59-bbe617acebad id=0x7f0a01f5)
    at androidx.fragment.app.FragmentStore.addFragment(FragmentStore.java:92)
    at androidx.fragment.app.FragmentManager.addFragment(FragmentManager.java:1422)
    at androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:387)
    at androidx.fragment.app.FragmentManager.executeOps(FragmentManager.java:1906)
    at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1814)
    at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1758)
    at androidx.fragment.app.FragmentManager.execSingleAction(FragmentManager.java:1670)
    at androidx.fragment.app.BackStackRecord.commitNowAllowingStateLoss(BackStackRecord.java:323)
    at androidx.fragment.app.FragmentStatePagerAdapter.finishUpdate(FragmentStatePagerAdapter.java:274)
    at androidx.viewpager.widget.ViewPager.populate(ViewPager.java:1244)
    at androidx.viewpager.widget.ViewPager.populate(ViewPager.java:1092)
    at androidx.viewpager.widget.ViewPager.onMeasure(ViewPager.java:1622)
    at android.view.View.measure(View.java:25466)
    at androidx.drawerlayout.widget.DrawerLayout.onMeasure(DrawerLayout.java:1156)
    at android.view.View.measure(View.java:25466)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6957)
    at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
    at androidx.appcompat.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:145)
    at android.view.View.measure(View.java:25466)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6957)
    at androidx.appcompat.widget.ActionBarOverlayLayout.onMeasure(ActionBarOverlayLayout.java:496)
    at android.view.View.measure(View.java:25466)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6957)
    at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
    at android.view.View.measure(View.java:25466)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6957)
    at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1552)
    at android.widget.LinearLayout.measureVertical(LinearLayout.java:842)
    at android.widget.LinearLayout.onMeasure(LinearLayout.java:721)
    at android.view.View.measure(View.java:25466)
    at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6957)
    at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
    at com.android.internal.policy.DecorView.onMeasure(DecorView.java:747)
    at android.view.View.measure(View.java:25466)
    at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:3402)
    at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:2246)
    at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2504)
    at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1948)
    at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8182)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1046)
    at android.view.Choreographer.doCallbacks(Choreographer.java:869)
    at android.view.Choreographer.doFrame(Choreographer.java:803)
    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1031)
    at android.os.Handler.handleCallback(Handler.java:938)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:223)
    at android.app.ActivityThread.main(ActivityThread.java:7669)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:594)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

App information

Device information

Firmware

AlvaroBrey commented 2 years ago

Was this while scrolling up and down through the media view, or while swiping side to side in a picture preview?

mjholub commented 2 years ago

In the preview mode.

mjholub commented 2 years ago

Also, the photo for which the bug appeared also wasn't accessible through file picker (in Pixeldroid for example, there was just like an empty photo). It did however load into external apps through sharing menu.

AlvaroBrey commented 2 years ago

Also, the photo for which the bug appeared also wasn't accessible through file picker (in Pixeldroid for example, there was just like an empty photo). It did however load into external apps through sharing menu.

Oh, that sounds like it could be related to #9328. Can you check if you have an (invalid) folder in your storage? If so, delete it and those "empty" pictures should disappear

mjholub commented 2 years ago

No, neither in the root folder nor in the folder first affected by the issue.