android.app.BackgroundServiceStartNotAllowedException

简介: android.app.BackgroundServiceStartNotAllowedException

android.app.BackgroundServiceStartNotAllowedException


--------- beginning of crash
05-09 01:25:24.465  2187  2187 E AndroidRuntime: FATAL EXCEPTION: main
05-09 01:25:24.465  2187  2187 E AndroidRuntime: Process: com.android.gallery3d, PID: 2187
05-09 01:25:24.465  2187  2187 E AndroidRuntime: java.lang.RuntimeException: Unable to start receiver com.android.gallery3d.app.PackagesMonitor: android.app.BackgroundServiceStartNotAllowedException: Not allowed to start service Intent { act=android.intent.action.PACKAGE_CHANGED dat=package:com.mycompany.anton_mokshyn.touchscreentest flg=0x5000010 cmp=com.android.gallery3d/.app.PackagesMonitor$AsyncService (has extras) }: app is in background uid UidRecord{2dc63ba u0a53 RCVR idle change:idle|uncached procs:0 seq(0,0,0)}
05-09 01:25:24.465  2187  2187 E AndroidRuntime:     at android.app.ActivityThread.handleReceiver(ActivityThread.java:4384)
05-09 01:25:24.465  2187  2187 E AndroidRuntime:     at android.app.ActivityThread.access$1600(ActivityThread.java:256)
05-09 01:25:24.465  2187  2187 E AndroidRuntime:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2102)
05-09 01:25:24.465  2187  2187 E AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:106)
05-09 01:25:24.465  2187  2187 E AndroidRuntime:     at android.os.Looper.loopOnce(Looper.java:201)
05-09 01:25:24.465  2187  2187 E AndroidRuntime:     at android.os.Looper.loop(Looper.java:288)
05-09 01:25:24.465  2187  2187 E AndroidRuntime:     at android.app.ActivityThread.main(ActivityThread.java:7870)
05-09 01:25:24.465  2187  2187 E AndroidRuntime:     at java.lang.reflect.Method.invoke(Native Method)
05-09 01:25:24.465  2187  2187 E AndroidRuntime:     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
05-09 01:25:24.465  2187  2187 E AndroidRuntime:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
05-09 01:25:24.465  2187  2187 E AndroidRuntime: Caused by: android.app.BackgroundServiceStartNotAllowedException: Not allowed to start service Intent { act=android.intent.action.PACKAGE_CHANGED dat=package:com.mycompany.anton_mokshyn.touchscreentest flg=0x5000010 cmp=com.android.gallery3d/.app.PackagesMonitor$AsyncService (has extras) }: app is in background uid UidRecord{2dc63ba u0a53 RCVR idle change:idle|uncached procs:0 seq(0,0,0)}
05-09 01:25:24.465  2187  2187 E AndroidRuntime:     at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1870)
05-09 01:25:24.465  2187  2187 E AndroidRuntime:     at android.app.ContextImpl.startService(ContextImpl.java:1826)
05-09 01:25:24.465  2187  2187 E AndroidRuntime:     at android.content.ContextWrapper.startService(ContextWrapper.java:776)
05-09 01:25:24.465  2187  2187 E AndroidRuntime:     at android.content.ContextWrapper.startService(ContextWrapper.java:776)
05-09 01:25:24.465  2187  2187 E AndroidRuntime:     at com.android.gallery3d.app.PackagesMonitor.onReceive(PackagesMonitor.java:40)
05-09 01:25:24.465  2187  2187 E AndroidRuntime:     at android.app.ActivityThread.handleReceiver(ActivityThread.java:4375)
05-09 01:25:24.465  2187  2187 E AndroidRuntime:     ... 9 more

 

BackgroundServiceStartNotAllowedException  |  Android Developers (google.cn)


解决方法:

Android O之后 要用startForegroundService 代替 startService

目录
相关文章
|
Linux
[RK3568 Android11]什么是输入子系统
[RK3568 Android11]什么是输入子系统
88 0
[RK3568 Android11]什么是输入子系统
|
Android开发
Android can-utils
Android can-utils
245 0
|
Java Android开发
rk3188/3288 android 5.x UsbDevice 获取 UsbInterface问题
rk3188/3288 android 5.x UsbDevice 获取 UsbInterface问题
218 0
错误: 程序包android.support.v7.app不存在 import android.support.v7.app.AppCompatActivity
错误: 程序包android.support.v7.app不存在 import android.support.v7.app.AppCompatActivity
433 0
android.support.v4.app.FragmentManager无法转换为android.app.FragmentManager
android.support.v4.app.FragmentManager无法转换为android.app.FragmentManager
146 0
android.support.v4.app.FragmentManager无法转换为android.app.FragmentManager
android.support.v4.app.Fragment$InstantiationException问题解决
android.support.v4.app.Fragment$InstantiationException问题解决
|
Java API Android开发
Android中Context的详细介绍
版权声明:本文为sydMobile原创文章,转载请务必注明出处! https://blog.csdn.net/sydMobile/article/details/78717605 文章最早发布于我的微信公众号 Android_De_Home 中,欢迎大家扫描下面二维码关注微信公众获取更多知识内容。
1186 0