jellyfin / jellyfin-androidtv

Android TV Client for Jellyfin
https://jellyfin.org
GNU General Public License v2.0
2.74k stars 468 forks source link

Fragment already added crash on source update #3164

Closed DavidFair closed 6 months ago

DavidFair commented 11 months ago

Describe the bug

  1. Play a video, replace the file at the same time (POSIX based server)
  2. Refresh metadata on server to pick up this file
  3. Android TV correctly gets notified the source updated, but tries to re-init the fragment leading to a crash

Logs


client: Jellyfin for Android TV client_version: 0.15.5 client_repository: https://github.com/jellyfin/jellyfin-androidtv type: crash_report format: markdown


Logs

Stack Trace:

java.lang.IllegalStateException: Fragment already added: FullDetailsFragment{642631f} (b06dcb20-2df1-4b06-85cb-8940628d2b9c id=0x7f0b00c7 tag=content)
    at androidx.fragment.app.FragmentStore.addFragment(FragmentStore.java:92)
    at androidx.fragment.app.FragmentManager.addFragment(FragmentManager.java:1481)
    at androidx.fragment.app.BackStackRecord.executePopOps(BackStackRecord.java:448)
    at androidx.fragment.app.FragmentManager.executeOps(FragmentManager.java:1962)
    at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1873)
    at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1817)
    at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1760)
    at androidx.fragment.app.FragmentManager$5.run(FragmentManager.java:547)
    at android.os.Handler.handleCallback(Handler.java:873)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:193)
    at android.app.ActivityThread.main(ActivityThread.java:6718)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

Logcat:

11-04 20:39:20.986 D/VideoManager(23211): Caught player timeline change - reason: SOURCE_UPDATE
11-04 20:39:21.245 D/jellyfin-apiclient(23211): Adding request to queue: https://example.com/Sessions/Playing/Progress
11-04 20:39:21.358 I/jellyfin-apiclient(23211): Response received from: https://example.com/Sessions/Playing/Progress
11-04 20:39:24.246 D/jellyfin-apiclient(23211): Adding request to queue: https://example.com/Sessions/Playing/Progress
11-04 20:39:24.258 D/VideoManager(23211): Caught player timeline change - reason: SOURCE_UPDATE
11-04 20:39:24.383 I/jellyfin-apiclient(23211): Response received from: https://example.com/Sessions/Playing/Progress
11-04 20:39:24.517 I/lyfin.androidt(23211): Background concurrent copying GC freed 119386(5MB) AllocSpace objects, 27(1212KB) LOS objects, 25% free, 21MB/28MB, paused 193us total 278.599ms
11-04 20:41:06.064 D/VideoManager(23211): Caught player timeline change - reason: SOURCE_UPDATE
11-04 20:41:07.072 D/jellyfin-apiclient(23211): Adding request to queue: https://example.com/Sessions/Playing/Progress
11-04 20:41:07.199 I/jellyfin-apiclient(23211): Response received from: https://example.com/Sessions/Playing/Progress
11-04 20:41:09.295 D/VideoManager(23211): Caught player timeline change - reason: SOURCE_UPDATE
11-04 20:41:09.566 I/lyfin.androidt(23211): Background concurrent copying GC freed 137522(6MB) AllocSpace objects, 14(280KB) LOS objects, 24% free, 23MB/30MB, paused 182us total 344.271ms
11-04 20:41:12.545 D/VideoManager(23211): Caught player timeline change - reason: SOURCE_UPDATE
11-04 20:41:17.354 D/VideoManager(23211): Caught player timeline change - reason: SOURCE_UPDATE
11-04 20:41:20.903 D/VideoManager(23211): Caught player timeline change - reason: SOURCE_UPDATE
11-04 20:41:20.952 D/CustomPlaybackOverlayFragment(23211): Stopping!
11-04 20:41:20.952 D/CustomPlaybackOverlayFragment(23211): this fragment belongs to the current session, ending it
11-04 20:41:20.955 D/PlaybackController(23211): stop called at 170336
11-04 20:41:21.106 I/jellyfin-apiclient(23211): ReportPlaybackStopped: Item 7cbf9cef-6d84-cfaf-c8dc-56ae552eb221, Ticks: 1703360000
11-04 20:41:21.106 D/jellyfin-apiclient(23211): Adding request to queue: https://example.com/Sessions/Playing/Stopped
11-04 20:41:21.299 D/SurfaceUtils(23211): disconnecting from surface 0xc638f008, reason disconnectFromSurface
11-04 20:41:21.367 I/ExoPlayerImpl(23211): Release bc7d004 [ExoPlayerLib/2.18.4] [sadang, UK 4K Android TV, MTC, 28] [goog.exo.core, goog.exo.ui, goog.exo.exoplayer, goog.exo.decoder, goog.exo.hls, goog.exo.datasource, goog.exo.ffmpeg, goog.exo.extractor]
11-04 20:41:21.400 D/ACRA    (23211): onActivityPaused class org.jellyfin.androidtv.ui.playback.PlaybackOverlayActivity
11-04 20:41:21.443 D/ACRA    (23211): onActivityStarted class org.jellyfin.androidtv.ui.browsing.MainActivity
11-04 20:41:21.447 I/ViewTarget(23211): Glide treats LayoutParams.WRAP_CONTENT as a request for an image the size of this device's screen dimensions. If you want to load the original image and are ok with the corresponding memory cost and OOMs (depending on the input size), use override(Target.SIZE_ORIGINAL). Otherwise, use LayoutParams.MATCH_PARENT, set layout_width and layout_height to fixed dimension, or use .override() with fixed dimensions.
11-04 20:41:21.448 I/chatty  (23211): uid=10091(org.jellyfin.androidtv) identical 2 lines
11-04 20:41:21.448 I/ViewTarget(23211): Glide treats LayoutParams.WRAP_CONTENT as a request for an image the size of this device's screen dimensions. If you want to load the original image and are ok with the corresponding memory cost and OOMs (depending on the input size), use override(Target.SIZE_ORIGINAL). Otherwise, use LayoutParams.MATCH_PARENT, set layout_width and layout_height to fixed dimension, or use .override() with fixed dimensions.
11-04 20:41:21.452 D/ACRA    (23211): onActivityResumed class org.jellyfin.androidtv.ui.browsing.MainActivity
11-04 20:41:21.472 D/BackgroundServiceFragment(23211): Restoring active backgrounds
11-04 20:41:21.473 D/BackgroundServiceFragment(23211): Restoring background drawable
11-04 20:41:21.658 D/ACRA    (23211): onActivityStopped class org.jellyfin.androidtv.ui.playback.PlaybackOverlayActivity
11-04 20:41:21.665 D/CustomPlaybackOverlayFragment(23211): Stopping!
11-04 20:41:21.666 D/ACRA    (23211): onActivityDestroyed class org.jellyfin.androidtv.ui.playback.PlaybackOverlayActivity
11-04 20:41:22.227 D/FullDetailsFragment(23211): current time 1699130482226 last playback event time 1699130481106 last refresh time 1699130278249
11-04 20:41:22.239 D/FullDetailsFragment(23211): Updating info after playback
11-04 20:41:22.241 D/jellyfin-apiclient(23211): Adding request to queue: https://example.com/Users/<UID>/Items/7cbf9cef6d84cfafc8dc56ae552eb221?format=json
11-04 20:41:22.241 D/FullDetailsFragment(23211): current time 1699130482241 last playback event time 1699130481106 last refresh time 1699130277842
11-04 20:41:22.247 D/FullDetailsFragment(23211): Updating info after playback
11-04 20:41:22.247 D/jellyfin-apiclient(23211): Adding request to queue: https://example.com/Users/<UID>/Items/7cbf9cef6d84cfafc8dc56ae552eb221?format=json
11-04 20:41:22.579 I/jellyfin-apiclient(23211): Response received from: https://example.com/Users/<UID>/Items/7cbf9cef6d84cfafc8dc56ae552eb221?format=json
11-04 20:41:22.763 D/NavigationRepositoryImpl(23211): Navigating back
11-04 20:41:22.795 D/jellyfin-apiclient(23211): Adding request to queue: https://example.com/Users/<UID>/Items/7cbf9cef-6d84-cfaf-c8dc-56ae552eb221?format=json
11-04 20:41:22.801 D/MediaManager(23211): Added event listener.  Total listeners: 5
11-04 20:41:22.815 W/RecyclerView(23211): No adapter attached; skipping layout
11-04 20:41:22.817 I/jellyfin-apiclient(23211): Response received from: https://example.com/Users/<UID>/Items/7cbf9cef6d84cfafc8dc56ae552eb221?format=json
11-04 20:41:22.825 D/MediaManager(23211): Removed event listener.  Total listeners: 4
11-04 20:41:22.892 I/jellyfin-apiclient(23211): Response received from: https://example.com/Users/<UID>/Items/7cbf9cef-6d84-cfaf-c8dc-56ae552eb221?format=json
11-04 20:41:22.955 D/FullDetailsFragment(23211): Item type: Movie
11-04 20:41:22.961 D/jellyfin-apiclient(23211): Adding request to queue: https://example.com/Items/7cbf9cef6d84cfafc8dc56ae552eb221/Similar?Fields=PrimaryImageAspectRatio%2CChildCount&UserId=<UID>&Limit=10&format=json
11-04 20:41:23.093 I/ViewTarget(23211): Glide treats LayoutParams.WRAP_CONTENT as a request for an image the size of this device's screen dimensions. If you want to load the original image and are ok with the corresponding memory cost and OOMs (depending on the input size), use override(Target.SIZE_ORIGINAL). Otherwise, use LayoutParams.MATCH_PARENT, set layout_width and layout_height to fixed dimension, or use .override() with fixed dimensions.
11-04 20:41:23.093 I/ViewTarget(23211): Glide treats LayoutParams.WRAP_CONTENT as a request for an image the size of this device's screen dimensions. If you want to load the original image and are ok with the corresponding memory cost and OOMs (depending on the input size), use override(Target.SIZE_ORIGINAL). Otherwise, use LayoutParams.MATCH_PARENT, set layout_width and layout_height to fixed dimension, or use .override() with fixed dimensions.
11-04 20:41:23.134 I/jellyfin-apiclient(23211): Response received from: https://example.com/Items/7cbf9cef6d84cfafc8dc56ae552eb221/Similar?Fields=PrimaryImageAspectRatio%2CChildCount&UserId=<UID>&Limit=10&format=json
11-04 20:41:23.151 I/jellyfin-apiclient(23211): Response received from: https://example.com/Sessions/Playing/Stopped
11-04 20:41:23.557 D/FullDetailsFragment(23211): current time 1699130483556 last playback event time 1699130481106 last refresh time 1699130482952
11-04 20:41:24.674 D/NavigationRepositoryImpl(23211): Navigating back
11-04 20:41:24.675 D/AndroidRuntime(23211): Shutting down VM
11-04 20:41:24.677 E/AndroidRuntime(23211): FATAL EXCEPTION: main
11-04 20:41:24.677 E/AndroidRuntime(23211): Process: org.jellyfin.androidtv, PID: 23211
11-04 20:41:24.677 E/AndroidRuntime(23211): java.lang.IllegalStateException: Fragment already added: FullDetailsFragment{642631f} (b06dcb20-2df1-4b06-85cb-8940628d2b9c id=0x7f0b00c7 tag=content)
11-04 20:41:24.677 E/AndroidRuntime(23211):     at androidx.fragment.app.FragmentStore.addFragment(FragmentStore.java:92)
11-04 20:41:24.677 E/AndroidRuntime(23211):     at androidx.fragment.app.FragmentManager.addFragment(FragmentManager.java:1481)
11-04 20:41:24.677 E/AndroidRuntime(23211):     at androidx.fragment.app.BackStackRecord.executePopOps(BackStackRecord.java:448)
11-04 20:41:24.677 E/AndroidRuntime(23211):     at androidx.fragment.app.FragmentManager.executeOps(FragmentManager.java:1962)
11-04 20:41:24.677 E/AndroidRuntime(23211):     at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1873)
11-04 20:41:24.677 E/AndroidRuntime(23211):     at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1817)
11-04 20:41:24.677 E/AndroidRuntime(23211):     at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1760)
11-04 20:41:24.677 E/AndroidRuntime(23211):     at androidx.fragment.app.FragmentManager$5.run(FragmentManager.java:547)
11-04 20:41:24.677 E/AndroidRuntime(23211):     at android.os.Handler.handleCallback(Handler.java:873)
11-04 20:41:24.677 E/AndroidRuntime(23211):     at android.os.Handler.dispatchMessage(Handler.java:99)
11-04 20:41:24.677 E/AndroidRuntime(23211):     at android.os.Looper.loop(Looper.java:193)
11-04 20:41:24.677 E/AndroidRuntime(23211):     at android.app.ActivityThread.main(ActivityThread.java:6718)
11-04 20:41:24.677 E/AndroidRuntime(23211):     at java.lang.reflect.Method.invoke(Native Method)
11-04 20:41:24.677 E/AndroidRuntime(23211):     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
11-04 20:41:24.677 E/AndroidRuntime(23211):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
11-04 20:41:24.679 E/ACRA    (23211): ACRA caught a IllegalStateException for org.jellyfin.androidtv
11-04 20:41:24.679 E/ACRA    (23211): java.lang.IllegalStateException: Fragment already added: FullDetailsFragment{642631f} (b06dcb20-2df1-4b06-85cb-8940628d2b9c id=0x7f0b00c7 tag=content)
11-04 20:41:24.679 E/ACRA    (23211):   at androidx.fragment.app.FragmentStore.addFragment(FragmentStore.java:92)
11-04 20:41:24.679 E/ACRA    (23211):   at androidx.fragment.app.FragmentManager.addFragment(FragmentManager.java:1481)
11-04 20:41:24.679 E/ACRA    (23211):   at androidx.fragment.app.BackStackRecord.executePopOps(BackStackRecord.java:448)
11-04 20:41:24.679 E/ACRA    (23211):   at androidx.fragment.app.FragmentManager.executeOps(FragmentManager.java:1962)
11-04 20:41:24.679 E/ACRA    (23211):   at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:1873)
11-04 20:41:24.679 E/ACRA    (23211):   at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1817)
11-04 20:41:24.679 E/ACRA    (23211):   at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1760)
11-04 20:41:24.679 E/ACRA    (23211):   at androidx.fragment.app.FragmentManager$5.run(FragmentManager.java:547)
11-04 20:41:24.679 E/ACRA    (23211):   at android.os.Handler.handleCallback(Handler.java:873)
11-04 20:41:24.679 E/ACRA    (23211):   at android.os.Handler.dispatchMessage(Handler.java:99)
11-04 20:41:24.679 E/ACRA    (23211):   at android.os.Looper.loop(Looper.java:193)
11-04 20:41:24.679 E/ACRA    (23211):   at android.app.ActivityThread.main(ActivityThread.java:6718)
11-04 20:41:24.679 E/ACRA    (23211):   at java.lang.reflect.Method.invoke(Native Method)
11-04 20:41:24.679 E/ACRA    (23211):   at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
11-04 20:41:24.679 E/ACRA    (23211):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
11-04 20:41:24.679 D/ACRA    (23211): Building report
11-04 20:41:24.690 D/ACRA    (23211): Starting collectors with priority FIRST
11-04 20:41:24.693 D/ACRA    (23211): Calling collector org.acra.collector.StacktraceCollector
11-04 20:41:24.693 D/ACRA    (23211): Calling collector org.acra.collector.LogCatCollector
11-04 20:41:24.693 D/ACRA    (23211): Calling collector org.acra.collector.DropBoxCollector
11-04 20:41:24.693 D/ACRA    (23211): Collector org.acra.collector.DropBoxCollector completed
11-04 20:41:24.696 D/ACRA    (23211): Collector org.acra.collector.StacktraceCollector completed
11-04 20:41:24.704 D/ACRA    (23211): Retrieving logcat output (buffer:default)...

App information

App version: 0.15.5 (150599)
Package name: org.jellyfin.androidtv
Build:

{"BOARD":"sadang","BOOTLOADER":"123456789","BRAND":"JVC","CPU_ABI":"armeabi-v7a","CPU_ABI2":"armeabi","DEVICE":"sadang","DISPLAY":"PTO6.220926.001","FINGERPRINT":"JVC\/MTCMSD6886UK\/sadang:9\/PTO6.220926.001\/9105384:user\/release-keys","HARDWARE":"m7322","HOST":"abfarm-2004-0377","ID":"PTO6.220926.001","IS_DEBUGGABLE":false,"IS_EMULATOR":false,"MANUFACTURER":"MTC","MODEL":"UK 4K Android TV","PERMISSIONS_REVIEW_REQUIRED":false,"PRODUCT":"MTCMSD6886UK","RADIO":"unknown","SUPPORTED_32_BIT_ABIS":["armeabi-v7a","armeabi"],"SUPPORTED_64_BIT_ABIS":[],"SUPPORTED_ABIS":["armeabi-v7a","armeabi"],"TAGS":"release-keys","TIME":1664184692000,"TYPE":"user","UNKNOWN":"unknown","USER":"android-build","VERSION":{"ACTIVE_CODENAMES":[],"BASE_OS":"","CODENAME":"REL","FIRST_SDK_INT":28,"INCREMENTAL":"9105384","PREVIEW_SDK_INT":0,"RELEASE":"9","RESOURCES_SDK_INT":28,"SDK":"28","SDK_INT":28,"SECURITY_PATCH":"2022-09-05"}}

Build config:

{"APPLICATION_ID":"org.jellyfin.androidtv","BUILD_TYPE":"release","DEBUG":false,"DEVELOPMENT":false,"VERSION_CODE":150599,"VERSION_NAME":"0.15.5"}

Device information

Android version: 9
Device brand: JVC
Device product: MTCMSD6886UK
Device model: UK 4K Android TV

Crash information

Start time: 2023-11-04T17:43:16.471+00:00
Crash time: 2023-11-04T20:41:24.764+00:00

Application version

0.15.5

Where did you install the app from?

Google Play

Device information

JVC 4K Android TV

Android version

Android 9

Jellyfin server version

10.8.11

nielsvanvelzen commented 11 months ago

Does this issue also happen in the latest 0.16 beta?

jellyfin-bot commented 7 months ago

This issue has gone 120 days without comment. To avoid abandoned issues, it will be closed in 21 days if there are no new comments.

If you're the original submitter of this issue, please comment confirming if this issue still affects you in the latest release or master branch, or close the issue if it has been fixed. If you're another user also affected by this bug, please comment confirming so. Either action will remove the stale label.

This bot exists to prevent issues from becoming stale and forgotten. Jellyfin is always moving forward, and bugs are often fixed as side effects of other changes. We therefore ask that bug report authors remain vigilant about their issues to ensure they are closed if fixed, or re-confirmed - perhaps with fresh logs or reproduction examples - regularly. If you have any questions you can reach us on Matrix or Social Media.