fluttercommunity / flutter_workmanager

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

Throws Errors on Android #560

Open kq1231 opened 3 weeks ago

kq1231 commented 3 weeks 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 2 weeks 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 1 week 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'
        }
    }
}