doublesymmetry / KotlinAudio

KotlinAudio is an Android audio player written in Kotlin, making it simpler to work with audio playback from streams and files.
Apache License 2.0
44 stars 70 forks source link

Fatal Exception: kotlin.UninitializedPropertyAccessException #37

Open vietmobilefolk opened 2 years ago

vietmobilefolk commented 2 years ago

I faced this issue when using react-native-track-player, which is utilizing KotlinAudio library: Version: v0.1.34

Fatal Exception: kotlin.UninitializedPropertyAccessException: lateinit property descriptionAdapter has not been initialized
       at com.doublesymmetry.kotlinaudio.notification.NotificationManager$destroy$1.invokeSuspend(NotificationManager.kt:295)
       at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
       at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
       at android.os.Handler.handleCallback(Handler.java:938)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loop(Looper.java:247)
       at android.app.ActivityThread.main(ActivityThread.java:8676)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
CDBridger commented 2 years ago

yeah this is been in quite a few versions of it. Could we get a fix please?

mpivchev commented 2 years ago

Please describe the steps you did that lead to the crash. Can you reproduce this in the example app?

vietmobilefolk commented 2 years ago

@mpivchev Although we occasionally experience it, it is reported in Crashlytics even though we can't always reproduce it in the example or our app. Although there aren't many users yet, incidents happen frequently. Just curious as to why we don't confirm that the descriptionAdapter is initialized before calling its function.

vietmobilefolk commented 2 years ago

Another observation concerning this problem is that it occurs when the app is running in the background.

mpivchev commented 2 years ago

Just curious as to why we don't confirm that the descriptionAdapter is initialized before calling its function.

That's definitely something we can do

s123121 commented 2 years ago

Can confirm, happen 100% whenever users put app in background (with another headless task registered)

dcvz commented 8 months ago

Is this issue still present for users?