Android Question java.lang.IllegalStateException: Not allowed to start service Intent

Douglas Farias

Expert
Licensed User
Longtime User
Hi all.
i m posted this question here.
https://www.b4x.com/android/forum/t...n-not-allowed-to-start-service-intent.101861/

As Erel reported, this is not a bug.
- how can i disable the starter to start when app is in background? or its possible start the starter service in background mode os something like this to avoid the crash?
i use the starter, i want disable this only in background.


the crash logs are on the link.
this error is on targetsdk 26+, on 25- i dont have any problem.

how i got this error?
when my device is connected via USB, and the screen is off, and i press compile debug or release i see this crash and the debug stop.

to fix now, i put a option on my device to never sleep, screen is on every time.

I see this same log crash in the firebase with another devices, however I do not know how to produce this error in an apk generated without being connected to the USB cable.

i m tryed to reproduce this error with apk downloaded from google play and i dont find any crash.
i really dont know how my app users are getting this error. any ideia?

thx
 

Douglas Farias

Expert
Licensed User
Longtime User
Please post the full Stacktrace. Without it is is hard to ask questions to help.
hi. its the same logs of the link on the first post.

log without filter.

thx
 
Upvote 0

Douglas Farias

Expert
Licensed User
Longtime User
What causes the starter service to start?
i think is when the main start. when main start it start the starter service too.

i get this error on all project. i can create a new project now, dont change any line of code and i will get this same crash.

to reproduce the error
- open a b4a (new project)
- connect the device with USB cable
- press debug or release button
- crash here. (the app dont start and i see the crash in log)

i see the crash when my screen is off (sleep) only.
when the screen is on i dont have crash.

thx
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
i think is when the main start. when main start it start the starter service too.
Not really. The starter service WAS running and your app was in background. Something causes your STARTER Service to start. Maybe an Intentfilter? Or a Broadcastreceiver?
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…