How to use the background process task in Flutter

If you want to run some tasks in a period and whatever your app in background or not, you can use the flutter_workmanager plugin!

But before you use it, you need to do some settings on Android and iOS. For Android settings, I think they missed somethings, I also spent more times and find the solution. After you done all of the plugin guidline, if your Android still can’t work, please try below steps:

  1. Upgrade you project to support ‘kotlin’ , this is not a must step, but the plugin is developped by kotlin, if you still want to use java language, you can try this.
  2. Update ‘android/build.gradle‘ file, set the ‘kotlin_version’ to 1.3.0 as below:
buildscript {
    ext.kotlin_version = '1.3.0'
    repositories {

and add the dependencies:

dependencies {
        classpath ''
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath ''

update the subprojects:

subprojects {
        project.configurations.all {
            resolutionStrategy.eachDependency { details ->
                if ( == ''
                        && !'multidex') ) {
                    details.useVersion "27.1.1"

                if ( == 'androidx.core'
                        && !'androidx') ) {
                    details.useVersion "1.0.1"


after that, you should can use the plugin on Anrdoid!

But there are some limitiation on iOS, it can’t control when will trigger the background task, it just control by iOS, so we just can test and debug this by Xcode, and actually, I tried on my iPhone device, but still can’t see the task to be trigger, so I also want to know whether is working on iOS 🙁

1,635 total views, 26 views today

Share your vote!

Do you like this post?
  • Fascinated
  • Happy
  • Sad
  • Angry
  • Bored
  • Afraid

You may also like...