Closed codehesionza closed 8 months ago
I managed to fix it by modifying the Bridge code.
I see all remove types are being handled by 1 function and then uses the array remove from kotlinplayer. So I changed the following
musicService.remove(indexes)
to
for (index in indexes) {
musicService.remove(index)
}
and did this:
@MainThread
fun remove(index: Int) {
player.remove(index)
}
Thanks for reporting! I'll take a look later today
I have the same issue, and it is happening for Android versions below 8
My guess is that Android < 8 did not have the ability to sort the way we're doing it This is the crashing line:
Collections.sort(sorted, Collections.reverseOrder());
Potential fix here: https://github.com/doublesymmetry/KotlinAudio/pull/100- haven't had a chance to test it on Android < 8 yet
I can confirm that this resolved the issue for me. Thank you @dcvz!
Describe the Bug Android TV Box running android 7.1.2 I'm using this package for a TV application using React Native TvOS. I tried removing an element from the queue and the app crashes on the android side.
I dont have any java or kotlin experience so not sure what else to do. I suspect the sort function is not available on android 7.1.2.
Any ideas?
Android Code causing the problem:
Crash:
Environment Info: