Closed Abhinavreddy-B closed 1 week ago
I already attatched (above) the full app logs extracted from logcat using custom build, those would be much helpful than apps crash logs, but never the less these are the crash logs of the app:
2024-11-12T16:47:52.993: android.app.ForegroundServiceDidNotStartInTimeException: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{f443eb6 u0 it.fast4x.rimusic/.service.modern.PlayerServiceModern}
android.app.ActivityThread.throwRemoteServiceException(ActivityThread.java:2078)
android.app.ActivityThread.access$2800(ActivityThread.java:259)
android.app.ActivityThread$H.handleMessage(ActivityThread.java:2303)
android.os.Handler.dispatchMessage(Handler.java:106)
android.os.Looper.loopOnce(Looper.java:233)
android.os.Looper.loop(Looper.java:344)
android.app.ActivityThread.main(ActivityThread.java:8249)
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:589)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1071)
2024-11-12T16:49:16.627: android.app.ForegroundServiceDidNotStartInTimeException: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{aa58bcb u0 it.fast4x.rimusic/.service.modern.PlayerServiceModern}
android.app.ActivityThread.throwRemoteServiceException(ActivityThread.java:2078)
android.app.ActivityThread.access$2800(ActivityThread.java:259)
android.app.ActivityThread$H.handleMessage(ActivityThread.java:2303)
android.os.Handler.dispatchMessage(Handler.java:106)
android.os.Looper.loopOnce(Looper.java:233)
android.os.Looper.loop(Looper.java:344)
android.app.ActivityThread.main(ActivityThread.java:8249)
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:589)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1071)
I dont know much about kotin, nor android applications.
but this piece of code looks suspecious to me:
In PlayerService.kt
, Inside the function maybeRestorePlayerQueue
:
runBlocking(Dispatchers.Main) {
player.setMediaItems(
queuedSong.map { mediaItem ->
mediaItem.mediaItem.buildUpon()
.setUri(mediaItem.mediaItem.mediaId)
.setCustomCacheKey(mediaItem.mediaItem.mediaId)
.build().apply {
mediaMetadata.extras?.putBoolean("isFromPersistentQueue", true)
}
}
// ... blah blah...
}
So this is blocking the main thread, and as seen in the logs, the OS thinks the application Hung, and force closes the application or something.
what do you guys think??
Sry, its not PlayerService
, its PlayerServiceModern
.
Fixed and available next version, thanks
Version of RiMusic
0.6.59 (both normal build and custom build)
Android version
11
I've done these:
Tell us how you trigger this bug
Note: It crashes only when persistent queue is enabled.
Also Note, crash is taking a couple of seconds to happen, upon quickly interacting with the player (before these couple of seconds) doesn't make the app crash.
I tried to extract full app logs using the custom build, I am attaching the catlog file below (I hope it would help)
log.zip
Submit a video
If you are on Android, please download a screen recorder and record your screen while you duplicating the problem as describe above.
If you are on Desktop, drag video into this box and it will be uploaded automatically
https://github.com/user-attachments/assets/8a9d4ab1-d47e-459f-aadb-d7473ef71b12
What was your expectation?
shouldnt crash
What more can you tell us? (Optional)
No response
Logs (Optional)
log.zip