-
Notifications
You must be signed in to change notification settings - Fork 9
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
Job not running #5
Comments
Hi there, your App looks fine, and I just tested it on my Test Device; the Job gets run there. Can you share more information about your Environment? Do you happen to run on API Level < 21, where the Job Scheduler isn't available? Could you test it on a recent Android Emulator? |
Hmm this is weird, it ran for a bit, but now doesn't. My device is Samsung Galaxy S5 with Android 6.0.1 so the API version should be good. It sometimes runs, but very rare and not consistently (I think sometimes when I close the app). I've also noticed this in the logs when it's running:
edit: just to confirm, tried it on a Pixel 2 and it runs smoothly there |
Thanks for bringing this to my attention. This is likely a problem with the Service implementation. One thing to note here is that the Android OS normally doesn't allow you to schedule jobs at a more frequent interval than 15min. One possibility (read "hack") to work around this is to Schedule OneShot Jobs, and reschedule another OneShot Job at the end, which is how the service is implemented. I'll investigate how this is behaving on lower API levels, it probably is breaking at that stage. Did you, by any chance, notice any exceptions thrown by the Jobscheduler ( |
No, I didn't see any exceptions thrown by the Jobscheduler, also I've just tried the example app in the repo. It seems to work! But I have no idea what I'm doing wrong in my example :) btw. do the jobs run when the phone is locked / in sleep mode? The logs seem to pause when the phone is locked. edit: I've had a bunch of weird behaviors, I'm not sure how to reproduce them but I'll list them anyway for now (sorry if this is vague):
|
Hey, I've followed the steps to install and configure the job scheduler, but it seems the jobs aren't running (nothing is printed in the logs, but also no error).
Is there some example app I could maybe compare mine with?
btw. as far as I could get, the examples are a bit wrong right? it should be
await AndroidJobScheduler.scheduleEvery( const Duration(seconds: 10), 42, iRunPeriodically);
instead of:
await AndroidJobScheduler.scheduleEvery( const Duration(seconds: 10), iRunPeriodically, 42);
I've pushed the example app I've been trying here: https://github.com/piotrpalek/test_flutter_job
The text was updated successfully, but these errors were encountered: