toasterofbread / spmp

A YouTube Music client with a focus on customisation of colours and song metadata. Built with Compose Multiplatform for Android and desktop.
GNU General Public License v3.0
1.17k stars 44 forks source link

[Bug] NullPointerException on radio load while signed in #72

Closed powl999 closed 1 year ago

powl999 commented 1 year ago

hi me again i just wanted to know if this error code is saying somthing importend i get it when i start playing a song but the app is still working normal

java.lang.NullPointerException at com.toasterofbread.spmp.api.radio.GetSongRadioKt$getSongRadio$2.invokeSuspend(Unknown Source:515) at com.toasterofbread.spmp.api.radio.GetSongRadioKt$getSongRadio$2.invoke(Unknown Source:8) at com.toasterofbread.spmp.api.radio.GetSongRadioKt$getSongRadio$2.invoke(Unknown Source:4) at androidx.core.R$dimen.startUndispatchedOrReturn(Unknown Source:4) at coil.util.-Contexts.withContext(Unknown Source:71) at com.toasterofbread.spmp.api.radio.GetSongRadioKt.getSongRadio(Unknown Source:60) at com.toasterofbread.spmp.api.radio.RadioInstance.getInitialSongs-IoAF18A(Unknown Source:144) at com.toasterofbread.spmp.api.radio.RadioInstance.access$getInitialSongs-IoAF18A(Unknown Source:0) at com.toasterofbread.spmp.api.radio.RadioInstance$loadContinuation$1$1.invokeSuspend(Unknown Source:120) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(Unknown Source:8) at kotlinx.coroutines.DispatchedTask.run(Unknown Source:100) at kotlinx.coroutines.internal.LimitedDispatcher.run(Unknown Source:12) at kotlinx.coroutines.scheduling.TaskImpl.run(Unknown Source:2) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(Unknown Source:79) Suppressed: coil.network.HttpException: [StandaloneCoroutine{Cancelling}@fd6c69b, Dispatchers.IO]

toasterofbread commented 1 year ago

Yeah, issues like this are known to happen occasionally. Does it happen every time you try to play a song or just sometimes? If you're logged in to YouTube music, please try to see if it works when you log out.

Basically, what's happening here is that there's something unknown or invalid in the data YouTube sends the app about the song radio, which causes an error. I added a feature recently which allows users to upload the invalid data when parsing the home feed fails so that I can take a look and figure out what's wrong. Once I implement that feature for radio parsing I should be able to fix this issue.

powl999 commented 1 year ago

only happening when i'm logged in but then every time

toasterofbread commented 1 year ago

Ok, that's good. I should be able to fix this issue if you update the app and upload the invalid data once I implement that feature in the next few days,

I'll ping you here then if that's alright?

powl999 commented 1 year ago

yeah thats ok

powl999 commented 1 year ago

I know now what doesn't work when I'm logged in and go to a song I can't press the next button there is no waiting queue but in the same scenario if I'm not logged in everything works

toasterofbread commented 1 year ago

Yeah, the error message happens when the song radio fail to load, which is why there's no queue.

toasterofbread commented 1 year ago

@powl999 I've added the error display which should let you upload the invalid data, it will appear at the bottom of the queue if the loading fails. See if the error still occurs and paste the link to the uploaded data if it does.

powl999 commented 1 year ago

ok

toasterofbread commented 1 year ago

ok

I forgot to mention, you can get the APK with the feature here once the build finishes. You'll probably have to uninstall the app first since the signatures won't match.

powl999 commented 1 year ago

the error occurde agin but ther is no erro display on the bottom of the queue Screenshot_20230719-234324_SpMp java.lang.NullPointerException at com.toasterofbread.spmp.api.radio.GetSongRadioKt$getSongRadio$2.invokeSuspend(Unknown Source:522) at com.toasterofbread.spmp.api.radio.GetSongRadioKt$getSongRadio$2.invoke(Unknown Source:8) at com.toasterofbread.spmp.api.radio.GetSongRadioKt$getSongRadio$2.invoke(Unknown Source:4) at androidx.core.R$dimen.startUndispatchedOrReturn(Unknown Source:4) at coil.util.-Contexts.withContext(Unknown Source:71) at com.toasterofbread.spmp.api.radio.GetSongRadioKt.getSongRadio(Unknown Source:60) at com.toasterofbread.spmp.api.radio.RadioInstance.getInitialSongs-IoAF18A(Unknown Source:144) at com.toasterofbread.spmp.api.radio.RadioInstance.access$getInitialSongs-IoAF18A(Unknown Source:0) at com.toasterofbread.spmp.api.radio.RadioInstance$loadContinuation$1$1.invokeSuspend(Unknown Source:124) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(Unknown Source:8) at kotlinx.coroutines.DispatchedTask.run(Unknown Source:100) at kotlinx.coroutines.internal.LimitedDispatcher.run(Unknown Source:12) at kotlinx.coroutines.scheduling.TaskImpl.run(Unknown Source:2) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(Unknown Source:79) Suppressed: coil.network.HttpException: [StandaloneCoroutine{Cancelling}@4738867, Dispatchers.IO]

powl999 commented 1 year ago

i just wanted to point out that I can now make an radio with artists and it makes an queue but when i us ean lonley song the error still happens

toasterofbread commented 1 year ago

Try this androidApp-universal-release.zip

powl999 commented 1 year ago

ok i will try that

powl999 commented 1 year ago

paste.ee/p/LZwQ4

there is the link

powl999 commented 1 year ago

i hope thats helping

toasterofbread commented 1 year ago

i hope thats helping

Perfect, thanks. I should be able to figure out what's wrong from that.

powl999 commented 1 year ago

nice

toasterofbread commented 1 year ago

Fingers crossed, this should fix it: androidApp-universal-release.zip

powl999 commented 1 year ago

Sorry i Was sleepping i will test it now

powl999 commented 1 year ago

Screenshot_20230720-105358_SpMp.png

Its fixed you are the best

toasterofbread commented 1 year ago

Its fixed you are the best

Awesome, thanks for helping with the debugging.

toasterofbread commented 1 year ago

Reopening until I commit the fix

Carter0108 commented 7 months ago

I'm still getting this problem? Is this just something that continually breaks from time to time?

toasterofbread commented 7 months ago

@Carter0108 You're probably experiencing #292