Caused by java.lang.IllegalStateException Not allowed to start service Intent報錯問題分析
Caused by: java.lang.IllegalStateException: Not allowed to start service Intent
Caused by: java.lang.IllegalStateException: Not allowed to start service Intent { cmp=package/xxx.xxxService }: app is in background uid UidRecord
Android 8.0(+)不允許在後臺啟動/建立Service,直接呼叫context.startService(intent)會宕機。
臨時解決辦法:
將編譯版本和目標版本降級到25,就可以避免因為8.0(26)不允許APP在後臺啟動Service而宕機。因為系統版本向後相容。
根本解決辦法:
1、SDK26 啟動Service的方法:context.startForegroundService(context, Service.class);
2、SDK26 Service啟動時,即在onCreate方法中,context.startForeground(id, new Notification());
相關推薦
Caused by java.lang.IllegalStateException Not allowed to start service Intent報錯問題分析
Caused by: java.lang.IllegalStateException: Not allowed to start service Intent Caused by: java.lang.IllegalStateException: Not allowed to start
解決java.lang.IllegalStateException: Not allowed to start service Intent xxxx app is in background u
問題描述 java.lang.IllegalStateException: Not allowed to start service Intent xxxx app is in background uid UidRecord 原因分析 Android 8.0 有以下調整: An
【spring boot】【elasticsearch】spring boot整合elasticsearch,啟動報錯Caused by: java.lang.IllegalStateException: availableProcessors is already set to [8], reje
spring boot整合elasticsearch, 啟動報錯: Caused by: java.lang.IllegalStateException: availableProcessors is already set to [8], rejecting [8] at
Caused by: java.lang.IllegalStateException: Ambiguous mapping. Cannot map 'practitionerController' m
今天在專案開發過程中遇到了這個錯誤: 錯誤:Caused by: java.lang.IllegalStateExce
Caused by: java.lang.IllegalStateException: SpringJUnit4ClassRunner requires JUnit 4.12 or higher.
如下圖 :報 Caused by: java.lang.IllegalStateException: SpringJUnit4ClassRunner requires JUnit 4.12 or higher. 有道翻譯一下:告訴我們junit測試jar依賴包版本太低了
關於微信登陸報錯的解決方法 Caused by: java.lang.IllegalStateException: Activity
先上圖 這種報錯 網上找了許久 找到了解決方法 把微信回撥那個activity 該成 這樣的就可以了 <activity android:name=".wxapi.WXEntryActivity" andr
android 8.0:Caused by: java.lang.IllegalStateException: Only fullscreen opaque activities can reques
Caused by: java.lang.IllegalStateException: Only fullscreen opaque activities can request orientation只有不透明的全屏activity可以自主設定介面方向我們的啟動頁面是設定了
Caused by java lang IllegalStateException SpringJUnit4Clas
size eat ted tin win 老師 -s illegal log 1、錯誤描述 java.lang.ExceptionInInitializerError at sun.reflect.NativeConstructorAccessorImpl.newI
spring cloud feign:Caused by: java.lang.IllegalStateException: RequestParam.value() was empty on parameter 0
use except app caused ise als stp lstat name 報錯之前: @RequestMapping(value = "hi", method = RequestMethod.GET)String hiService(@Request
Not allowed to load local resource: 報錯解決方法
出現這樣的錯一般為直接引用專案外的資源(圖片,視訊). 然後開啟網頁結果 不允許直接訪問我們就需要配置一個虛擬路徑來訪問系統中的資源. 容器為tomcat解決方法 1. 開啟tomcat服務介面 在下面選擇Modules 然後選擇Add Web Module
Caused by: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value
整合spring+mybatis 報錯以下錯誤: 我完全是IDEA的問題!!!找了半天啊!!! org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.wechat.mo
spring aop定義增強時候報錯 Caused by: java.lang.IllegalArgumentException: Pointcut is not well-formed: expec
Caused by: java.lang.IllegalArgumentException: Pointcut is not well-formed: expecting ')' at character position 11 Caused by: java.lang.IllegalArg
tomcat啟動報錯Caused by: java.lang.IllegalArgumentException: The main resource set specifiedis not valid
原因:筆者電腦中不存在“G:\Tomcatdata\data\sourcecode\chapter03\helloapp]”此路徑、檔案,所以刪除tomcat檔案目錄下的conf\server.xml檔案中的對應資訊(Context)後,tomcat能正常啟動。 錯誤資訊如下:
Caused by: java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment
在驗證碼的顯示問題出現如下錯誤: Caused by: java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment 修改
Caused by java lang ClassNotFoundException Could not load
1、錯誤描述WARN:2015-05-01 13:26:10[localhost-startStop-1] - HHH000402: Using Hibernate built-in connection pool (not for production use!)WARN:2
Caused by: java.lang.IllegalArgumentException: @EnableAsync annotation metadata was not injected
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.context.annotat
Caused by: java.lang.IllegalArgumentException: Could not locate call adapter for rx.Observable錯誤
public class TRService { public static final String BASE_TRC_URL = "http://www.tuling123.com/openapi/"; private static Retrofit
spring aop Caused by: java.lang.IllegalArgumentException: Pointcut is not well-formed: 報錯
最近這幾天在公司研究spring aop(面向切面程式設計),在使用spring 註解實現時,遇到了一個bug,由此記錄一下,方便日後讀閱;報錯如下圖所示: 由於是第一次接觸spring aop 當時就懵逼了,在網上搜索相關的錯誤,最後找到了自己的問題出
Caused by: java.lang.RuntimeException :HMAC-SHA1 not supported
本次問題解決花費了一天時間,問題描述如下: 因專案使用了阿里雲簡訊功能,涉及到的三方包有:sdk-core-3.3.1.jar、aliyun-java-sdk-dysmsapi-1.0.0.jar 專案使用jetty啟動,在本地呼叫一直沒有問題,故已經排除程式碼問題,但在c
Spring報錯 Failed to read candidate component class: file Caused by: java.lang.IncompatibleClassChange
今天寫一個SpringMVC的小例子,遇到一個很怪異的問題。 先說說開發環境:IDEA+SpringMVC+Gradle 先看看我的build.gradle檔案引入的包: dependencies { testCompile group