flutter_server_box icon indicating copy to clipboard operation
flutter_server_box copied to clipboard

1.0.1051版本频繁在后台抛出异常

Open sky96111 opened this issue 1 year ago • 3 comments

描述BUG

1.0.1051版本会在关闭应用设置中“后台运行”的情况下,在后台会经常崩溃并抛出异常

复现步骤

  1. 关闭程序中“在后台运行”选项
  2. 关闭程序
  3. 系统会不定时收到程序异常的消息

期望结果

程序不抛出异常

实际结果

系统会不定时收到程序异常

截图

设备

OnePlus 12 Android 14 App 1.0.1051

更多信息

Generated by AppErrorsTracking 1.3(6)
Project URL: https://github.com/KitsunePie/AppErrorsTracking
===============
[Device Brand]: OnePlus
[Device Model]: CPH2581
[Display]: CPH2581_14.0.0.830(EX01)
[Android Version]: 14
[Android API Level]: 34
[System Locale]: zh_CN_#Hans
[Process ID]: 1604
[User ID]: 0
[CPU ABI]: arm64-v8a
[Package Name]: tech.lolli.toolbox
[Version Name]: 1.0.1051
[Version Code]: 10513
[Target SDK]: 34
[Min SDK]: 21
[Error Type]: JVM
[Crash Time]: 2024-08-06T12:08:06.008
[Stack Trace]:
java.lang.RuntimeException: Unable to create service id.flutter.flutter_background_service.BackgroundService: android.app.ForegroundServiceStartNotAllowedException: Service.startForeground() not allowed due to mAllowStartForeground false: service tech.lolli.toolbox/id.flutter.flutter_background_service.BackgroundService
	at android.app.ActivityThread.handleCreateService(ActivityThread.java:5015)
	at android.app.ActivityThread.-$$Nest$mhandleCreateService(Unknown Source:0)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2492)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loopOnce(Looper.java:255)
	at android.os.Looper.loop(Looper.java:364)
	at android.app.ActivityThread.main(ActivityThread.java:8938)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:572)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1053)
Caused by: android.app.ForegroundServiceStartNotAllowedException: Service.startForeground() not allowed due to mAllowStartForeground false: service tech.lolli.toolbox/id.flutter.flutter_background_service.BackgroundService
	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:4900)
	at android.os.Parcel.readParcelable(Parcel.java:4882)
	at android.os.Parcel.createExceptionOrNull(Parcel.java:3082)
	at android.os.Parcel.createException(Parcel.java:3071)
	at android.os.Parcel.readException(Parcel.java:3054)
	at android.os.Parcel.readException(Parcel.java:2996)
	at android.app.IActivityManager$Stub$Proxy.setServiceForeground(IActivityManager.java:6761)
	at android.app.Service.startForeground(Service.java:862)
	at androidx.core.app.d2.a(Unknown Source:0)
	at androidx.core.app.e2$b.a(Unknown Source:14)
	at androidx.core.app.e2.a(Unknown Source:6)
	at id.flutter.flutter_background_service.BackgroundService.updateNotificationInfo(Unknown Source:86)
	at id.flutter.flutter_background_service.BackgroundService.onCreate(Unknown Source:70)
	at android.app.ActivityThread.handleCreateService(ActivityThread.java:4990)
	... 9 more

sky96111 avatar Aug 06 '24 04:08 sky96111

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Title: 1.0.1051 version frequently throws exceptions in the background

Issues-translate-bot avatar Aug 06 '24 04:08 Issues-translate-bot

看样子是第三方库的锅(?)

https://github.com/ekasetiawans/flutter_background_service/issues/421#issuecomment-2287970477

lollipopkit avatar Aug 14 '24 06:08 lollipopkit

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


It seems to be the fault of the third-party library (?)

https://github.com/ekasetiawans/flutter_background_service/issues/421#issuecomment-2287970477

Issues-translate-bot avatar Aug 14 '24 06:08 Issues-translate-bot