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 run the default app that is created with the new project I get the error
Error while executing: am startservice com.test.myapp/com.android.tools.fd.runtime.InstantRunService
Starting service: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.test.myapp/com.android.tools.fd.runtime.InstantRunService }
Error: app is in background uid null
I can still open the app manually on my phone and it works, but it doesn't start automatically and I get that error message.