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 something, I also spent more time and find the solution. After you have done all of the plugin guidelines, if your Android still can’t work, please try below steps:

  1. Upgrade your project to support ‘kotlin’ , this is not a must step, but the plugin is developed 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:

Do you want to be a good trading in cTrader?   >> TRY IT! <<
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 Android!

But there are some limitations 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 🙁


Views: 16
Total Views: 275 ,

Leave a Reply

Your email address will not be published. Required fields are marked *