fluttercommunity / flutter_workmanager

A Flutter plugin which allows you to execute code in the background on Android and iOS.
862 stars 277 forks source link

Throws Errors on Android #560

Open kq1231 opened 5 months ago

kq1231 commented 5 months ago

After the package is installed using flutter pub add workmanager, the build process throws an error when compiling for Android.

FAILURE: Build failed with an exception.

A snippet is shown below:

PrplYoru commented 5 months ago

Cloning the github repo and referencing the local version in your pubspec.yaml instead of the server one seems to work, at least as a temporary solution until a new version is officially released. A simple guide on how it's done can be found here

milan-r-dhameliya commented 5 months ago

I Was Facing same error cause kotlin-stdlib and kotlin-stdlib-jdk8 are conflicting in my case. So I Have Excluded Conflicting Transitive Dependencies Just Like This In my app/build.gradle and added below code worked for me.

configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        if (details.requested.group == 'org.jetbrains.kotlin' && details.requested.name == 'kotlin-stdlib-jdk8') {
            details.useTarget 'org.jetbrains.kotlin:kotlin-stdlib:1.8.10'
        }
    }
}
realnihal commented 3 months ago

Thanks @milan-r-dhameliya this worked for me.