-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
java.lang.IllegalStateException: Tried to start task BackgroundTask while in foreground, but this is not allowed #65
Comments
This error happens every 3hours (period: 108000) only xiaomi devices or only my device for some background restrics and permissions. |
java.lang.IllegalStateException: Any update on this? the error occurs in multiple Android versions 7-9 and others |
Facing the Same Issue. OS Version: 9Device: ONEPLUS A6010RAM Free: 28.8%Disk Free: 52.2%#0. Crashed: main -- Fatal Exception: java.lang.IllegalStateException: Tried to start task BackgroundTask while in the foreground, but this is not allowed. |
It seems this is a behavior wanted by react native as stated here :
Until you set this boolean to true this will crash. The library does not set this boolean which means it is set to default (false) Line 26 in 3db6df1
To fix this issue you have 2 choices: Hope this help. |
I tried to set this boolean to true and it seems to be working fine. |
i was facing this issue even after setting |
Phone: Xiaomi redmi note 4x
Tried to start task BackgroundTask while in foreground, but this is not allowed
at (Headless.JsTaskContext.java: 92)
at(Headless.JsTaskService.java: 125)
and etc...
How to fix it ?
BackgroundTask.define(() => { GetCountryNames(); BackgroundTask.finish() }) BackgroundTask.schedule({ period: 10800 })
The text was updated successfully, but these errors were encountered: