question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ExoPlayer 2.15.1 throws NoSuchElementException on loading Live LL HLS manifest

See original GitHub issue

I’ll forward a link to the stream to the dev email, along with a bugreport.zip.

Reproducible in: ExoPlayer 2.15.1 demo ExoPlayer 2.13.0 demo Notable that the stream plays in the ExoPlayer 2.10.8 demo (although also noted that LL HLS support was not announced until 2.13.0, just noting here that it played without apparent problems in ExoPlayer 2.10.8).

Describe how the issue can be reproduced, ideally using the ExoPlayer demo app:

  • Added the manifest URL (sent to the dev email) to the media.exolist.json file in the demo app
  • Launch the demo app
  • Select the asset from the list

Expected:

  • When the player loads, the master and chunklist manifest requests are successful
  • As with ExoPlayer 2.10.8, segments are then requested and can be played

Actual:

  • When the player loads, the master and chunklist manifest requests are successful
  • No segments are requested
  • A NoSuchElementException is thrown, and playback does not start:
2021-10-22 10:47:55.845 1849-1849/com.google.android.exoplayer2.demo W/exoplayer2.dem: Accessing hidden method Landroid/media/AudioTrack;->getLatency()I (greylist, reflection, allowed)
2021-10-22 10:47:55.858 1849-1849/com.google.android.exoplayer2.demo I/ExoPlayerImpl: Init 7d9e151 [ExoPlayerLib/2.15.1] [sunfish, Pixel 4a, Google, 30]
2021-10-22 10:47:55.888 1849-1849/com.google.android.exoplayer2.demo D/EventLogger: playWhenReady [eventTime=0.00, mediaPos=0.00, window=0, true, USER_REQUEST]
2021-10-22 10:47:55.897 1849-1849/com.google.android.exoplayer2.demo D/EventLogger: timeline [eventTime=0.01, mediaPos=0.00, window=0, periodCount=1, windowCount=1, reason=PLAYLIST_CHANGED
2021-10-22 10:47:55.897 1849-1849/com.google.android.exoplayer2.demo D/EventLogger:   period [?]
2021-10-22 10:47:55.897 1849-1849/com.google.android.exoplayer2.demo D/EventLogger:   window [?, seekable=false, dynamic=true]
2021-10-22 10:47:55.897 1849-1849/com.google.android.exoplayer2.demo D/EventLogger: ]
2021-10-22 10:47:55.898 1849-1849/com.google.android.exoplayer2.demo D/EventLogger: mediaItem [eventTime=0.01, mediaPos=0.00, window=0, reason=PLAYLIST_CHANGED]
2021-10-22 10:47:55.901 1849-1849/com.google.android.exoplayer2.demo D/EventLogger: state [eventTime=0.01, mediaPos=0.00, window=0, BUFFERING]
2021-10-22 10:47:55.941 1849-1849/com.google.android.exoplayer2.demo D/EventLogger: surfaceSize [eventTime=0.05, mediaPos=0.00, window=0, 1080, 2160]
2021-10-22 10:47:55.955 1849-1849/com.google.android.exoplayer2.demo D/EventLogger: loading [eventTime=0.07, mediaPos=0.00, window=0, period=0, true]
2021-10-22 10:47:58.652 1849-1972/com.google.android.exoplayer2.demo E/LoadTask: Unexpected exception loading stream
      java.util.NoSuchElementException
        at com.google.common.collect.Iterables.getLast(Iterables.java:807)
        at com.google.android.exoplayer2.source.hls.playlist.HlsPlaylistParser.parseMediaPlaylist(HlsPlaylistParser.java:861)
        at com.google.android.exoplayer2.source.hls.playlist.HlsPlaylistParser.parse(HlsPlaylistParser.java:277)
        at com.google.android.exoplayer2.source.hls.playlist.HlsPlaylistParser.parse(HlsPlaylistParser.java:68)
        at com.google.android.exoplayer2.upstream.ParsingLoadable.load(ParsingLoadable.java:176)
        at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:409)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:923)
2021-10-22 10:47:58.665 1849-1849/com.google.android.exoplayer2.demo E/EventLogger: internalError [eventTime=2.77, mediaPos=0.00, window=0, loadError
      com.google.android.exoplayer2.upstream.Loader$UnexpectedLoaderException: Unexpected NoSuchElementException: null
        at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:430)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:923)
     Caused by: java.util.NoSuchElementException
        at com.google.common.collect.Iterables.getLast(Iterables.java:807)
        at com.google.android.exoplayer2.source.hls.playlist.HlsPlaylistParser.parseMediaPlaylist(HlsPlaylistParser.java:861)
        at com.google.android.exoplayer2.source.hls.playlist.HlsPlaylistParser.parse(HlsPlaylistParser.java:277)
        at com.google.android.exoplayer2.source.hls.playlist.HlsPlaylistParser.parse(HlsPlaylistParser.java:68)
        at com.google.android.exoplayer2.upstream.ParsingLoadable.load(ParsingLoadable.java:176)
        at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:409)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
        at java.lang.Thread.run(Thread.java:923) 
    ]
2021-10-22 10:47:58.668 1849-1955/com.google.android.exoplayer2.demo E/ExoPlayerImplInternal: Playback error
      com.google.android.exoplayer2.ExoPlaybackException: Source error
        at com.google.android.exoplayer2.ExoPlayerImplInternal.handleIoException(ExoPlayerImplInternal.java:624)
        at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:600)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:223)
        at android.os.HandlerThread.run(HandlerThread.java:67)
     Caused by: com.google.android.exoplayer2.upstream.Loader$UnexpectedLoaderException: Unexpected NoSuchElementException: null
        at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:430)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:923)
     Caused by: java.util.NoSuchElementException
        at com.google.common.collect.Iterables.getLast(Iterables.java:807)
        at com.google.android.exoplayer2.source.hls.playlist.HlsPlaylistParser.parseMediaPlaylist(HlsPlaylistParser.java:861)
        at com.google.android.exoplayer2.source.hls.playlist.HlsPlaylistParser.parse(HlsPlaylistParser.java:277)
        at com.google.android.exoplayer2.source.hls.playlist.HlsPlaylistParser.parse(HlsPlaylistParser.java:68)
        at com.google.android.exoplayer2.upstream.ParsingLoadable.load(ParsingLoadable.java:176)
        at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:409)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
        at java.lang.Thread.run(Thread.java:923) 

Output of running “adb bugreport” in the console shortly after encountering the issue

  • Sent to the dev email

URI to test content for reproduction

  • Sent to the dev email

ExoPlayer version number

  • Noted above

Android versions: 6.0.1 and 11 Android devices: Samsung S5 (Android 6.0.1) and Google Pixel 4a (Android 11)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
marcbaechingercommented, Oct 29, 2021

Thanks! I was able to play your stream.

0reactions
marcbaechingercommented, Oct 29, 2021

Looks like gradle JDK needs to be to Java 11. You can configure this in File > Settings. Then search for gradle where you can select the JDK used by gradle.

The fix will land in the next release. I think this will happen approximately within the next two weeks or so.

Read more comments on GitHub >

github_iconTop Results From Across the Web

RELEASENOTES.md - google/ExoPlayer - Sourcegraph
live edge ([#9784](https://github.com/google/ExoPlayer/issues/9784)). * Video: ... Fix `NoSuchElementException` thrown when an HLS manifest declares.
Read more >
Why Android Exoplayer hls live streaming not working? link ...
I have used the library. implementation 'com.google.android.exoplayer:exoplayer-core:2.18.1' implementation 'com.google.android.exoplayer ...
Read more >
RELEASENOTES.md · Gitee 极速下载/ExoPlayer - Gitee.com
Fix NoSuchElementException thrown when an HLS manifest declares #EXT-X-RENDITION-REPORT at the beginning of the playlist (#9592). RTMP extension:.
Read more >
Low-latency live streaming with ExoPlayer - Medium
The target live offset is taken from the manifest or playlist, or may be set by the app. The player will also take...
Read more >
ExoPlayer - bytemeta
ExoPlayer repo issues. ... exoPlayer 2.15.0 cause java.lang. ... ExoPlayer 2.15.1 throws NoSuchElementException on loading Live LL HLS manifest. menscikov.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found