Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

android.app.ForegroundServiceStartNotAllowedException: startForegroundService() not allowed due to mAllowStartForeground false: service me.him188.ani.debug/me.him188.ani.app.domain.torrent.service.AniTorrentService #1203

Open
Him188 opened this issue Nov 15, 2024 · 1 comment
Labels
N 一般优先级

Comments

@Him188
Copy link
Member

Him188 commented Nov 15, 2024

问题描述

手机锁屏, 用 AS 启动 debug 版本就可以复现

复现步骤

No response

Ani 版本号

4.0.0-beta03

操作系统

Android

应用日志

19:45:30.791 com.miui.daemon       E  Process: me.him188.ani.debug, PID: 8050 (Ask Gemini)
                                      java.lang.RuntimeException: Unable to create application me.him188.ani.android.AniApplication: android.app.ForegroundServiceStartNotAllowedException: startForegroundService() not allowed due to mAllowStartForeground false: service me.him188.ani.debug/me.him188.ani.app.domain.torrent.service.AniTorrentService
                                      	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:8299)
                                      	at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0)
                                      	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2652)
                                      	at android.os.Handler.dispatchMessage(Handler.java:107)
                                      	at android.os.Looper.loopOnce(Looper.java:249)
                                      	at android.os.Looper.loop(Looper.java:337)
                                      	at android.app.ActivityThread.main(ActivityThread.java:9572)
                                      	at java.lang.reflect.Method.invoke(Native Method)
                                      	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:593)
                                      	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:935)
                                      Caused by: android.app.ForegroundServiceStartNotAllowedException: startForegroundService() not allowed due to mAllowStartForeground false: service me.him188.ani.debug/me.him188.ani.app.domain.torrent.service.AniTorrentService
                                      	at android.app.ForegroundServiceStartNotAllowedException$1.createFromParcel(ForegroundServiceStartNotAllowedException.java:54)
                                      	at android.app.ForegroundServiceStartNotAllowedException$1.createFromParcel(ForegroundServiceStartNotAllowedException.java:50)
                                      	at android.os.Parcel.readParcelableInternal(Parcel.java:5089)
                                      	at android.os.Parcel.readParcelable(Parcel.java:5071)
                                      	at android.os.Parcel.createExceptionOrNull(Parcel.java:3251)
                                      	at android.os.Parcel.createException(Parcel.java:3240)
                                      	at android.os.Parcel.readException(Parcel.java:3223)
                                      	at android.os.Parcel.readException(Parcel.java:3165)
                                      	at android.app.IActivityManager$Stub$Proxy.startService(IActivityManager.java:6748)
                                      	at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1971)
                                      	at android.app.ContextImpl.startForegroundService(ContextImpl.java:1946)
                                      	at android.content.ContextWrapper.startForegroundService(ContextWrapper.java:843)
                                      	at me.him188.ani.android.AniApplication.startAniTorrentService(AniApplication.kt:152)
                                      	at me.him188.ani.android.AniApplication.onCreate(AniApplication.kt:88)
                                      	at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1393)
                                      	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:8291)
                                      	at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0) 
                                      	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2652) 
                                      	at android.os.Handler.dispatchMessage(Handler.java:107) 
                                      	at android.os.Looper.loopOnce(Looper.java:249) 
                                      	at android.os.Looper.loop(Looper.java:337) 
                                      	at android.app.ActivityThread.main(ActivityThread.java:9572) 
                                      	at java.lang.reflect.Method.invoke(Native Method) 
                                      	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:593) 
                                      	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:935) 
19:45:30.793 me.him188.ani.debug   I  Process is going to kill itself! (Ask Gemini)
                                      java.lang.Exception
                                      	at android.os.Process.killProcess(Process.java:1495)
                                      	at com.android.internal.os.RuntimeInit$KillApplicationHandler.uncaughtException(RuntimeInit.java:193)
                                      	at me.him188.ani.android.AniApplication.onCreate$lambda$1(AniApplication.kt:77)
                                      	at me.him188.ani.android.AniApplication.$r8$lambda$owX-2BMKfsehve8bqLZnhUt8MP4(Unknown Source:0)
                                      	at me.him188.ani.android.AniApplication$$ExternalSyntheticLambda0.uncaughtException(D8$$SyntheticClass:0)
                                      	at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1071)
                                      	at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1066)
                                      	at java.lang.Thread.dispatchUncaughtException(Thread.java:2306)


@Him188 Him188 added the N 一般优先级 label Nov 15, 2024
@StageGuard
Copy link
Member

#1194 相关

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
N 一般优先级
Projects
None yet
Development

No branches or pull requests

2 participants