Error: application is in the background uid null

I created a new Android project on IntelliJ CE 2017.2 and got this error . I added the maven section as described in the answer.

When I launch the default application that is created with a new project, I get an error

Runtime Error: am launchervice com.test.myapp / com.android.tools.fd.runtime.InstantRunService

Initial Service: Intent {act = android.intent.action.MAIN cat = [android.intent.category.LAUNCHER] cmp = com.test.myapp / com.android.tools.fd.runtime.InstantRunService}

Error: application is in the background uid null

I can still open the application manually on my phone and it works, but it does not start automatically, and I get this error message.

+5
source share
1 answer

I saw this error using android api 26/27 (Oreo). Oreo has new background execution limits . tl; dr you must run the services in the foreground.

to start the service using adb use adb shell am start-foreground-service

instead of adb shell am startservice .

+5
source

Source: https://habr.com/ru/post/1273246/


All Articles