XilinJia / Podcini

Open source podcast player for Android in Kotlin with androidx.media3
GNU General Public License v3.0
111 stars 5 forks source link

Crash when click on subscription on subscription page #41

Closed metronidazole closed 2 months ago

metronidazole commented 2 months ago

Checklist

App version

4.10.0

Where did you get the app from

Other

Android version

14

Device model

No response

First occurred

unclear

Steps to reproduce

  1. Open subscriptions page
  2. Click on subscription

Expected behaviour

Subscription page for that sub should opened

Current behaviour

Podcini crashes

Logs

Environment Android version: 14 OS version: 5.15.150-android14-11-g3502b3132535 Podcini version: 4.10.0 Model: Pixel 8 Pro Device: husky Product: husky

Crash info

Podcini version: 4.10.0

StackTrace

java.lang.NullPointerException: Can't toast on a thread that has not called Looper.prepare()
    at com.android.internal.util.Preconditions.checkNotNull(Preconditions.java:168)
    at android.widget.Toast.getLooper(Toast.java:186)
    at android.widget.Toast.<init>(Toast.java:171)
    at android.widget.Toast.makeText(Toast.java:502)
    at android.widget.Toast.makeText(Toast.java:491)
    at android.widget.Toast.makeText(Toast.java:549)
    at ac.mdiq.podcini.ui.fragment.FeedItemlistFragment$Companion.initializeTTS$lambda$0(SourceFile:664)
    at ac.mdiq.podcini.ui.fragment.FeedItemlistFragment$Companion.$r8$lambda$oVX5gJSMI8xKh8qNTggdqADH75U(SourceFile:0)
    at ac.mdiq.podcini.ui.fragment.FeedItemlistFragment$Companion$$ExternalSyntheticLambda0.onInit(SourceFile:0)
    at android.speech.tts.TextToSpeech.lambda$dispatchOnInit$0(TextToSpeech.java:934)
    at android.speech.tts.TextToSpeech.$r8$lambda$y-uaMPlobiYouiY_T7xFoJSwPww(Unknown Source:0)
    at android.speech.tts.TextToSpeech$$ExternalSyntheticLambda13.run(D8$$SyntheticClass:0)
    at android.speech.tts.TextToSpeech.dispatchOnInit(TextToSpeech.java:943)
    at android.speech.tts.TextToSpeech.initTts(TextToSpeech.java:907)
    at android.speech.tts.TextToSpeech.<init>(TextToSpeech.java:800)
    at android.speech.tts.TextToSpeech.<init>(TextToSpeech.java:773)
    at android.speech.tts.TextToSpeech.<init>(TextToSpeech.java:762)
    at android.speech.tts.TextToSpeech.<init>(TextToSpeech.java:746)
    at ac.mdiq.podcini.ui.fragment.FeedItemlistFragment$Companion.initializeTTS(SourceFile:657)
    at ac.mdiq.podcini.ui.fragment.FeedItemlistFragment$onCreateView$9.invokeSuspend(SourceFile:201)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(SourceFile:33)
    at kotlinx.coroutines.DispatchedTask.run(SourceFile:106)
    at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(SourceFile:115)
    at kotlinx.coroutines.scheduling.TaskImpl.run(SourceFile:100)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(SourceFile:584)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(SourceFile:793)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(SourceFile:697)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(SourceFile:684)
    Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@f3e2d0, Dispatchers.IO]
XilinJia commented 2 months ago

Thank you. That's solved. It was trying to toast a message in an non-UI coroutine when initialization of TTS engine fails. BTW, you don't have a TTS engine on your system?

metronidazole commented 2 months ago

Cool thanks!

BTW, you don't have a TTS engine on your system?

Nope. That's only guaranteed to be available if the user has a stock device (with all the built in google services). If they're running a custom ROM then it's not guaranteed.

XilinJia commented 2 months ago

OK, will manage about TTS start accordingly.

XilinJia commented 2 months ago

Done in 4.10.1

metronidazole commented 2 months ago

Confirmed fixed