null2264 / yokai

Free and open source manga reader for Android
Apache License 2.0
754 stars 18 forks source link

Crash after clicking on updated manga list notification #217

Open paressz opened 1 month ago

paressz commented 1 month ago

Steps to reproduce

  1. Do global updates
  2. Wait update done
  3. Click on updated list notification
  4. The app crashed randomly, sometimes it didn't

Expected behavior

  1. Do global updates
  2. Updates done
  3. Click on updated manga list notification
  4. see updated mangas

Actual behavior

  1. Do global updates
  2. Wait update done
  3. Click on updated manga list notification
  4. The app crashed randomly, sometimes it didn't

Crash logs

App version: 1.8.5.7 (standard, 532e1faae, 148, 2024-09-05T04:27:26Z) Android version: 14 (SDK 34) Android build ID: AP2A.240905.003 Device brand: POCO Device manufacturer: Xiaomi Device name: moonstone Device model: POCO X5 5G Device product name: lineage_stone

java.lang.Throwable: android.app.RemoteServiceException$ForegroundServiceDidNotStartInTimeException: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{4be2359 u0 eu.kanade.tachiyomi.yokai/androidx.work.impl.foreground.SystemForegroundService c:eu.kanade.tachiyomi.yokai} at android.app.ActivityThread.generateForegroundServiceDidNotStartInTimeException(ActivityThread.java:2243) at android.app.ActivityThread.throwRemoteServiceException(ActivityThread.java:2214) at android.app.ActivityThread.-$$Nest$mthrowRemoteServiceException(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2520) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loopOnce(Looper.java:232) at android.os.Looper.loop(Looper.java:317) at android.app.ActivityThread.main(ActivityThread.java:8601) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:583) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:863) Caused by: android.app.StackTrace: Last startServiceCommon() call for this service was made here at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1953) at android.app.ContextImpl.startForegroundService(ContextImpl.java:1907) at android.content.ContextWrapper.startForegroundService(ContextWrapper.java:832) at androidx.core.content.ContextCompat$Api26Impl.startForegroundService(Unknown Source:0) at androidx.work.impl.Processor.startForeground(SourceFile:87) at androidx.work.impl.utils.WorkForegroundUpdater$1.run(SourceFile:144) at androidx.work.Worker$2.run$androidx$work$impl$utils$SerialExecutorImpl$Task(SourceFile:5) at androidx.work.Worker$2.run(SourceFile:1221) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644) at java.lang.Thread.run(Thread.java:1012)

--------- beginning of crash 09-29 10:09:00.764 31044 31044 E AndroidRuntime: FATAL EXCEPTION: main 09-29 10:09:00.764 31044 31044 E AndroidRuntime: Process: eu.kanade.tachiyomi.yokai, PID: 31044 09-29 10:09:00.764 31044 31044 E AndroidRuntime: android.app.RemoteServiceException$ForegroundServiceDidNotStartInTimeException: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{a31278a u0 eu.kanade.tachiyomi.yokai/androidx.work.impl.foreground.SystemForegroundService c:eu.kanade.tachiyomi.yokai} 09-29 10:09:00.764 31044 31044 E AndroidRuntime: at android.app.ActivityThread.generateForegroundServiceDidNotStartInTimeException(ActivityThread.java:2243) 09-29 10:09:00.764 31044 31044 E AndroidRuntime: at android.app.ActivityThread.throwRemoteServiceException(ActivityThread.java:2214) 09-29 10:09:00.764 31044 31044 E AndroidRuntime: at android.app.ActivityThread.-$$Nest$mthrowRemoteServiceException(Unknown Source:0) 09-29 10:09:00.764 31044 31044 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2520) 09-29 10:09:00.764 31044 31044 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:107) 09-29 10:09:00.764 31044 31044 E AndroidRuntime: at android.os.Looper.loopOnce(Looper.java:232) 09-29 10:09:00.764 31044 31044 E AndroidRuntime: at android.os.Looper.loop(Looper.java:317) 09-29 10:09:00.764 31044 31044 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:8601) 09-29 10:09:00.764 31044 31044 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) 09-29 10:09:00.764 31044 31044 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:583) 09-29 10:09:00.764 31044 31044 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:863) 09-29 10:09:00.764 31044 31044 E AndroidRuntime: Caused by: android.app.StackTrace: Last startServiceCommon() call for this service was made here 09-29 10:09:00.764 31044 31044 E AndroidRuntime: at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1953) 09-29 10:09:00.764 31044 31044 E AndroidRuntime: at android.app.ContextImpl.startForegroundService(ContextImpl.java:1907) 09-29 10:09:00.764 31044 31044 E AndroidRuntime: at android.content.ContextWrapper.startForegroundService(ContextWrapper.java:832) 09-29 10:09:00.764 31044 31044 E AndroidRuntime: at androidx.core.content.ContextCompat$Api26Impl.startForegroundService(Unknown Source:0) 09-29 10:09:00.764 31044 31044 E AndroidRuntime: at androidx.work.impl.Processor.startForeground(SourceFile:87) 09-29 10:09:00.764 31044 31044 E AndroidRuntime: at androidx.work.impl.utils.WorkForegroundUpdater$1.run(SourceFile:144) 09-29 10:09:00.764 31044 31044 E AndroidRuntime: at androidx.work.Worker$2.run$androidx$work$impl$utils$SerialExecutorImpl$Task(SourceFile:5) 09-29 10:09:00.764 31044 31044 E AndroidRuntime: at androidx.work.Worker$2.run(SourceFile:1221) 09-29 10:09:00.764 31044 31044 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 09-29 10:09:00.764 31044 31044 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644) 09-29 10:09:00.764 31044 31044 E AndroidRuntime: at java.lang.Thread.run(Thread.java:1012) 09-29 20:14:50.893 15347 15347 E AndroidRuntime: FATAL EXCEPTION: main 09-29 20:14:50.893 15347 15347 E AndroidRuntime: Process: eu.kanade.tachiyomi.yokai, PID: 15347 09-29 20:14:50.893 15347 15347 E AndroidRuntime: android.app.RemoteServiceException$ForegroundServiceDidNotStartInTimeException: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{4be2359 u0 eu.kanade.tachiyomi.yokai/androidx.work.impl.foreground.SystemForegroundService c:eu.kanade.tachiyomi.yokai} 09-29 20:14:50.893 15347 15347 E AndroidRuntime: at android.app.ActivityThread.generateForegroundServiceDidNotStartInTimeException(ActivityThread.java:2243) 09-29 20:14:50.893 15347 15347 E AndroidRuntime: at android.app.ActivityThread.throwRemoteServiceException(ActivityThread.java:2214) 09-29 20:14:50.893 15347 15347 E AndroidRuntime: at android.app.ActivityThread.-$$Nest$mthrowRemoteServiceException(Unknown Source:0) 09-29 20:14:50.893 15347 15347 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2520) 09-29 20:14:50.893 15347 15347 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:107) 09-29 20:14:50.893 15347 15347 E AndroidRuntime: at android.os.Looper.loopOnce(Looper.java:232) 09-29 20:14:50.893 15347 15347 E AndroidRuntime: at android.os.Looper.loop(Looper.java:317) 09-29 20:14:50.893 15347 15347 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:8601) 09-29 20:14:50.893 15347 15347 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) 09-29 20:14:50.893 15347 15347 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:583) 09-29 20:14:50.893 15347 15347 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:863) 09-29 20:14:50.893 15347 15347 E AndroidRuntime: Caused by: android.app.StackTrace: Last startServiceCommon() call for this service was made here 09-29 20:14:50.893 15347 15347 E AndroidRuntime: at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1953) 09-29 20:14:50.893 15347 15347 E AndroidRuntime: at android.app.ContextImpl.startForegroundService(ContextImpl.java:1907) 09-29 20:14:50.893 15347 15347 E AndroidRuntime: at android.content.ContextWrapper.startForegroundService(ContextWrapper.java:832) 09-29 20:14:50.893 15347 15347 E AndroidRuntime: at androidx.core.content.ContextCompat$Api26Impl.startForegroundService(Unknown Source:0) 09-29 20:14:50.893 15347 15347 E AndroidRuntime: at androidx.work.impl.Processor.startForeground(SourceFile:87) 09-29 20:14:50.893 15347 15347 E AndroidRuntime: at androidx.work.impl.utils.WorkForegroundUpdater$1.run(SourceFile:144) 09-29 20:14:50.893 15347 15347 E AndroidRuntime: at androidx.work.Worker$2.run$androidx$work$impl$utils$SerialExecutorImpl$Task(SourceFile:5) 09-29 20:14:50.893 15347 15347 E AndroidRuntime: at androidx.work.Worker$2.run(SourceFile:1221) 09-29 20:14:50.893 15347 15347 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 09-29 20:14:50.893 15347 15347 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644) 09-29 20:14:50.893 15347 15347 E AndroidRuntime: at java.lang.Thread.run(Thread.java:1012) --------- beginning of main 09-29 20:14:50.967 15347 15347 E : Something went wrong! 09-29 20:14:50.967 15347 15347 E : android.app.RemoteServiceException$ForegroundServiceDidNotStartInTimeException: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{4be2359 u0 eu.kanade.tachiyomi.yokai/androidx.work.impl.foreground.SystemForegroundService c:eu.kanade.tachiyomi.yokai} 09-29 20:14:50.967 15347 15347 E : at android.app.ActivityThread.generateForegroundServiceDidNotStartInTimeException(ActivityThread.java:2243) 09-29 20:14:50.967 15347 15347 E : at android.app.ActivityThread.throwRemoteServiceException(ActivityThread.java:2214) 09-29 20:14:50.967 15347 15347 E : at android.app.ActivityThread.-$$Nest$mthrowRemoteServiceException(Unknown Source:0) 09-29 20:14:50.967 15347 15347 E : at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2520) 09-29 20:14:50.967 15347 15347 E : at android.os.Handler.dispatchMessage(Handler.java:107) 09-29 20:14:50.967 15347 15347 E : at android.os.Looper.loopOnce(Looper.java:232) 09-29 20:14:50.967 15347 15347 E : at android.os.Looper.loop(Looper.java:317) 09-29 20:14:50.967 15347 15347 E : at android.app.ActivityThread.main(ActivityThread.java:8601) 09-29 20:14:50.967 15347 15347 E : at java.lang.reflect.Method.invoke(Native Method) 09-29 20:14:50.967 15347 15347 E : at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:583) 09-29 20:14:50.967 15347 15347 E : at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:863) 09-29 20:14:50.967 15347 15347 E : Caused by: android.app.StackTrace: Last startServiceCommon() call for this service was made here 09-29 20:14:50.967 15347 15347 E : at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1953) 09-29 20:14:50.967 15347 15347 E : at android.app.ContextImpl.startForegroundService(ContextImpl.java:1907) 09-29 20:14:50.967 15347 15347 E : at android.content.ContextWrapper.startForegroundService(ContextWrapper.java:832) 09-29 20:14:50.967 15347 15347 E : at androidx.core.content.ContextCompat$Api26Impl.startForegroundService(Unknown Source:0) 09-29 20:14:50.967 15347 15347 E : at androidx.work.impl.Processor.startForeground(SourceFile:87) 09-29 20:14:50.967 15347 15347 E : at androidx.work.impl.utils.WorkForegroundUpdater$1.run(SourceFile:144) 09-29 20:14:50.967 15347 15347 E : at androidx.work.Worker$2.run$androidx$work$impl$utils$SerialExecutorImpl$Task(SourceFile:5) 09-29 20:14:50.967 15347 15347 E : at androidx.work.Worker$2.run(SourceFile:1221) 09-29 20:14:50.967 15347 15347 E : at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 09-29 20:14:50.967 15347 15347 E : at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644) 09-29 20:14:50.967 15347 15347 E : at java.lang.Thread.run(Thread.java:1012) 09-29 20:14:51.153 15975 15975 E i:error_handler: Not starting debugger since process cannot load the jdwp agent. 09-29 20:14:51.167 15976 15976 E tachiyomi.yokai: Not starting debugger since process cannot load the jdwp agent. 09-29 20:14:51.346 15976 16026 E tachiyomi.yokai: No package ID 77 found for resource ID 0x770b000f. 09-29 20:14:51.347 15976 16026 E tachiyomi.yokai: No package ID 77 found for resource ID 0x770b000f. 09-29 20:14:53.073 15975 16029 E SQLiteLog: (283) recovered 284 frames from WAL file /data/data/eu.kanade.tachiyomi.yokai/databases/tachiyomi.db-wal 09-29 20:14:53.104 15976 16015 E SQLiteLog: (5) statement aborts at 2: [PRAGMA journal_mode=TRUNCATE] database is locked

Yōkai version

1.8.5.7

Android version

Android 14

Device

Xiaomi Poco X5

Other details

Sometimes the app crashed and sometimes didn't when clicking on updated manga list notification

Acknowledgements

null2264 commented 1 month ago

Unfortunately, this is an internal bug from within Android itself, especially problematic in Android 14. And as far as I know there is currently no known workaround for it.