首页 > 其他分享 >android.app.BackgroundServiceStartNotAllowedException

android.app.BackgroundServiceStartNotAllowedException

时间:2023-05-09 10:55:05浏览次数:46  
标签:25 01 BackgroundServiceStartNotAllowedException app 09 2187 android AndroidRunti

--------- 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 

   

标签:25,01,BackgroundServiceStartNotAllowedException,app,09,2187,android,AndroidRunti
From: https://www.cnblogs.com/wanglongjiang/p/17384171.html

相关文章

  • Android TextView 设置超链接、关键字高亮等效果
    之前做TextView关键字高亮效果,使用的是Html.fromHtml(Stringsource)方法,然后通过TextView的setText(CharSequencetext)方法来显示后来测试此方法在部分手机上显示有问题,如Nexus4,华为P6等等。于是乎只能继续寻找别的解决办法了,在这里Mark一下。这里用到了SpannableString类......
  • 金汇战神程序小精灵App下载
    金汇战神系金汇科技出品普通牌战神程序,玩法齐全,无区域限制,高性价比高,调试安装更加快捷方便,安装时间大大缩短,适用于各种需要快速安装的场所。添加微心zscxmj咨询索取金汇战神小精灵App下载二维码链接手机上安装好金汇战神小精灵app后,连接上蓝牙后怎么使用怎么操作呢?其实很简单......
  • 找不到VCRUNTIME140D_APP.dll(windows系统)
    运行QT程序时,弹这个提示,找了很久,发现是qt的dll复制错了比如Qt5Guid.dll,"D:\QT\5.15.2\winrt_x64_msvc2015\bin\Qt5Guid.dll"  winrt的会缺VCRUNTIME.DLL"D:\QT\5.15.2\msvc2015_64\bin\Qt5Guid.dll"用MSVC这个才是对的  winrt跟window7、10、11不是......
  • 解Android系统的进程间通信原理(二)----RPC机制(转)
    解Android系统的进程间通信原理(二)----RPC机制理解Android系统中的轻量级解决方案RPC的原理,需要先回顾一下JAVA中的RMI(RemoteMethodInvocation)这个易于使用的纯JAVA方案(用来实现分布式应用)。有关RMI的相关知识,可以通过下图来归纳:Android中的RPC也是参考了JAVA中......
  • android native jni 代码
    数组的常用操作:  对象的常用操作: 另外 这个里面有JNI各个方法的说明 可以当做api 2、推荐一个网址 里面关于jni的学习内容比较多    ===============================================================================================================//找到类......
  • 统信UOS自动化测试:安装配置appium流程
     自己安装的时候,配置路径要记得改 一、安装python1升级:sudoaptupdatesudoaptupgrade-y2安装编译依赖包:sudoaptinstallbuild-essential-ysudoaptinstalllibncurses5-devlibgdbm-devlibnss3-devlibssl-devlibreadline-devlibffi-dev-ysudoapt-geti......
  • Android系统中自带的图标&一些预定义样式&参考颜色值
    Android系统中自带了很多图标,我们的程序可以方便使用。Android™1.5android.R.drawableIconResourceshttp://since2006.com/android/1.5-drawables.phpAndroid™1.6android.R.drawableIconResourceshttp://since2006.com/android/1.6-drawables.ph......
  • uniapp读取本地通讯录
    官方文档:https://uniapp.dcloud.net.cn/api/system/contact.html#addphonecontactcreated(){//#ifdefAPP-PLUSthis.getLocalContact()//#endif},methods:{getLocalContact(){lettype=plus.contacts.ADDRESSBOOK_PHONEplu......
  • Android学习之RecyclerView
    RecyclerView是android-support-v7-21版本中新增的一个Widget,官方介绍RecyclerView是ListView的升级版本,更加先进和灵活。开发环境 -IDE:ADT -SDK:AndroidL首先在AndroidSDKManager上下载AndroidSupportRepository,它会在sdk/extras/android目录下生成m2reposito......
  • Android5.0 v7扩展包之RecyclerView
    Android5.0v7扩展包之RecyclerViewAndroid开发文章 androidRecyclerViewRecyclerView。RecylerView简介TheRecyclerViewwidgetisamoreadvancedandflexibleversionofListView.ThiswidgetisaContainerfordisplayinglargedatasetsthatcanbescrolledvery......