[Bug] App crashes/freezes during background playback (Persists in v5.2.0)
Checklist
- [x] I make sure that the issue is NOT a duplicate of pinned issues
- [x] I make sure I am using the LATEST version - check here
- [x] I understand that issues with limited impact, such as those occurring on specific devices or under specific network conditions, will not be fixed
- [x] I have attached the error report in the issue
Describe the bug
Description
When playing a video in the background, the app almost always encounters an error and freezes. This issue has persisted through the last four beta versions, and unfortunately, it still occurs in the official v5.2.0 release.
Expected Behavior
The video should continue playing smoothly in the background without any interruptions or errors.
Actual Behavior
The playback freezes completely. Simply returning to the app and tapping the video does not resume playback. The only way to play the video again is to go into the system settings, force stop the app, and clear the cache.
Additional Context
This issue only occurs during background playback. The app functions perfectly fine when playing videos in the foreground.
App Version: v5.2.0 (and the previous 4 beta `versions)```
Exception
- User Action: play stream
- Request: Player error[type=ERROR_CODE_IO_NETWORK_CONNECTION_FAILED] occurred while playing https://www.youtube.com/watch?v=vxGEEq9T-gg
- Content Country: GB
- Content Language: ko-KR
- App Language: ko_KR
- Service: YouTube (Anonymous)
- Version: 5.2.0
- OS: Linux Android 16 - 36
Crash log
androidx.media3.exoplayer.ExoPlaybackException: Source error
at androidx.media3.exoplayer.ExoPlayerImplInternal.handleIoException(r8-map-id-c0516b28995b7ee05916d6916abd6008f164779f86cdacbb6d441fe25326605f:17)
at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(r8-map-id-c0516b28995b7ee05916d6916abd6008f164779f86cdacbb6d441fe25326605f:470)
at android.os.Handler.dispatchMessage(Handler.java:128)
at android.os.Looper.dispatchMessage(Looper.java:358)
at android.os.Looper.loopOnce(Looper.java:288)
at android.os.Looper.loop(Looper.java:392)
at android.os.HandlerThread.run(HandlerThread.java:139)
Caused by: androidx.media3.datasource.HttpDataSource$HttpDataSourceException: java.net.UnknownHostException: Unable to resolve host "rr2---sn-n3cgv5qc5oq-bh26l.googlevideo.com": No address associated with hostname
at org.schabi.newpipe.player.datasource.YoutubeHttpDataSource.open(r8-map-id-c0516b28995b7ee05916d6916abd6008f164779f86cdacbb6d441fe25326605f:751)
at androidx.media3.datasource.DefaultDataSource.open(r8-map-id-c0516b28995b7ee05916d6916abd6008f164779f86cdacbb6d441fe25326605f:865)
at androidx.media3.datasource.TeeDataSource.open(r8-map-id-c0516b28995b7ee05916d6916abd6008f164779f86cdacbb6d441fe25326605f:3)
at androidx.media3.datasource.cache.CacheDataSource.openNextSource(r8-map-id-c0516b28995b7ee05916d6916abd6008f164779f86cdacbb6d441fe25326605f:255)
at androidx.media3.datasource.cache.CacheDataSource.open(r8-map-id-c0516b28995b7ee05916d6916abd6008f164779f86cdacbb6d441fe25326605f:171)
at androidx.media3.datasource.StatsDataSource.open(r8-map-id-c0516b28995b7ee05916d6916abd6008f164779f86cdacbb6d441fe25326605f:11)
at androidx.media3.exoplayer.source.chunk.ContainerMediaChunk.load(r8-map-id-c0516b28995b7ee05916d6916abd6008f164779f86cdacbb6d441fe25326605f:89)
at androidx.media3.exoplayer.upstream.Loader$LoadTask.run(r8-map-id-c0516b28995b7ee05916d6916abd6008f164779f86cdacbb6d441fe25326605f:35)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1100)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:1572)
Caused by: java.net.UnknownHostException: Unable to resolve host "rr2---sn-n3cgv5qc5oq-bh26l.googlevideo.com": No address associated with hostname
at java.net.Inet6AddressImpl.lookupHostByName(Inet6AddressImpl.java:156)
at java.net.Inet6AddressImpl.lookupAllHostAddr(Inet6AddressImpl.java:103)
at java.net.InetAddress.getAllByName(InetAddress.java:1152)
at com.android.okhttp.Dns$1.lookup(Dns.java:41)
at com.android.okhttp.internal.http.RouteSelector.resetNextInetSocketAddress(RouteSelector.java:178)
at com.android.okhttp.internal.http.RouteSelector.nextProxy(RouteSelector.java:144)
at com.android.okhttp.internal.http.RouteSelector.next(RouteSelector.java:86)
at com.android.okhttp.internal.http.StreamAllocation.findConnection(StreamAllocation.java:176)
at com.android.okhttp.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:128)
at com.android.okhttp.internal.http.StreamAllocation.newStream(StreamAllocation.java:97)
at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:289)
at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:232)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:465)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:131)
at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.connect(DelegatingHttpsURLConnection.java:90)
at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:30)
at org.schabi.newpipe.player.datasource.YoutubeHttpDataSource.makeConnection$1(r8-map-id-c0516b28995b7ee05916d6916abd6008f164779f86cdacbb6d441fe25326605f:377)
at org.schabi.newpipe.player.datasource.YoutubeHttpDataSource.open(r8-map-id-c0516b28995b7ee05916d6916abd6008f164779f86cdacbb6d441fe25326605f:498)
... 10 more
Caused by: android.system.GaiException: android_getaddrinfo failed: EAI_NODATA (No address associated with hostname)
at libcore.io.Linux.android_getaddrinfo(Native Method)
at libcore.io.ForwardingOs.android_getaddrinfo(ForwardingOs.java:134)
at libcore.io.BlockGuardOs.android_getaddrinfo(BlockGuardOs.java:222)
at libcore.io.ForwardingOs.android_getaddrinfo(ForwardingOs.java:134)
at java.net.Inet6AddressImpl.lookupHostByName(Inet6AddressImpl.java:135)
... 27 more
Version
5.2.0
Frequency
Always (100% of the time)
Device
Galaxy S23
Steps to reproduce the bug
No response
Additional context
No response
Unable to resolve host "rr2---sn-n3cgv5qc5oq-bh26l.googlevideo.com": No address associated with hostname
This shows that the app can't access google's server at the time. This can happen because
- some system restriction/configuration
- a real network issue (isp/google)
can you test with 5.1.1 for some days and see if the bug persists?
Please go #2576