1

I just imported the package background_location, and didn't use it. Even though I get this error


* What went wrong:
Execution failed for task ':background_location:compileDebugKotlin'.
> Compilation error. See log for more details

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 43s
Exception: Gradle task assembleDebug failed with exit code 1

Tried changing kotlin version, changed minSdkVersion but no change.

1 Answer 1

0

Here are a few things you can do:

  1. run flutter clean and flutter pub get and then try again.
  2. go to your android/app/build.gradle and upgrade the Kotlin version. Latest right now is 1.6.0 i.e. ext.kotlin_version = '1.6.0'
  3. Go to android/gradle/wrapper/gradle-wrapper.properties and upgrade distributionURL to distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip

This is where I got these solutions from, Flutter: Execution failed for task ':app:compileDebugKotlin'.

Update: Change your dependency in your pubspec.yaml to:

background_location: 
    git:
      url: https://github.com/hilalbaig/background_location.git
      ref: master

Here is the reference: https://github.com/Almoullim/background_location/issues/150#issuecomment-1132144094

Sign up to request clarification or add additional context in comments.

4 Comments

already tried all of these
what version are you using of background_location?
background_location: ^0.8.1 . latest
I have updated my solution, please check if it solves.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.