skip to Main Content

i am building flutter app , everything is fine but after instaling location libary in flutter , they started giving me error when i run my app , error is

"Launching libmain.dart on sdk gphone x86 64 in debug mode…
main.dart:1

FAILURE: Build failed with an exception.

  • What went wrong:
    The Android Gradle plugin supports only Kotlin Gradle plugin version 1.5.20 and higher.
    The following dependencies do not satisfy the required version:
    project ‘:location’ -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.20

  • 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.

BUILD FAILED in 1s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)"

kindy help me anyone , i have tried lots of things , tried to change version etc. but not work help me

i want solution of this error in flutter

2

Answers


  1. you have to update the version code at build.gradle located at androidbuild.gradle path.

    buildscript {
    ext.kotlin_version = '1.6.21'
    repositories {
        google()
        mavenCentral()
    }
    
    dependencies {
        classpath 'com.android.tools.build:gradle:4.1.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
    

    change the version no. of ext.kotlin_version.

    Login or Signup to reply.
  2. Open your project using android studio if the version is old android studio notification will pop up saying upgrade your kotlin version then update it

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search