Bug? java.lang.IllegalStateException: Not allowed to start service Intent

Status
Not open for further replies.

Douglas Farias

Expert
Licensed User
Longtime User
Hi.
i m using the B4A 8.80 and a Xiaomi Mi A2 Lite (Android 9 P)
when i compile a project, with my screen turned off i got this errors.

In debug.


In release i got error too (no filter logs)


this error occurs even in an empty project in B4A.
if I create an empty project now, without using any libs, and not writing lines of code I get this error when debugging or releasing.

if my screen is on i dont have this error, i got this error only when my screen is off, (turned off with power button)

how can i avoid this error?
on my samsung s7 edge i dont have this error, with android N. and here on xiaomi i got this every time.
it looks a problem with services, the only service in a clean project is the (starter).
how can i try catch this error?

i found anothers questions about this error on the forum, but all questions is related about firebase, and i m not using any lib. only a new b4a project

i found this post on stackoverflow
https://stackoverflow.com/questions...eexception-not-allowed-to-start-service-inten
It means that you cannot start a service when your app is in the background
but is the starter service, i dont have control of this.
can i set startForegroundService to starter service?


PS: i dont have error with targetSdkVersion 25-, i got the error using 26
thx
 
Last edited:

Douglas Farias

Expert
Licensed User
Longtime User

Douglas Farias

Expert
Licensed User
Longtime User
starter can not be a foreground service
hmmm. this is a big problem.
cant debug or release apps in background. the solution for now is set my phone to never sleep.

i see a lot of this logs on the firebase crash*s
but i dont know how reproduce this error without my phone coneccted to b4a.

thx.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…