Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Gradle plugin supports only Kotlin Gradle plugin version 1.5.20 and higher

error: 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 ':ar_flutter_plugin' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.50

android/build.gradle

buildscript {
    ext.kotlin_version = '1.6.10'
    repositories {
        google()
        mavenCentral()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:7.3.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

allprojects {
    repositories {
        google()
        mavenCentral()
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
    delete rootProject.buildDir
}


like image 372
umutcan bağdu Avatar asked Dec 13 '25 06:12

umutcan bağdu


2 Answers

I actually tried to solve this problem in Flutter: enter image description here

I found a solution for that here:

Why am I getting this warning and how to resolve it "This version only understands SDK XML versions up to 2 but an SDK XML..."

But then I ran into similar problem as yours.

AFAIK the main problem is the limitations in the libraries we are using, and that it isn't prepared for the level we want to.

If you use AS and look here:

enter image description here

under Flutter plugins, and find the module which is complaining

enter image description here

In my case it was "location:", and if you expand the "android" folder here you can find the contents of the gradle file:

enter image description here

AS you see, the level of 'ext.kotlin_version' is 1.4.20, which is too low.

Either we need to find a new provider to our libraries, try to convince the creator to release an updated version, or try to manually change it (I personally don't like to tamper with libraries that way).

like image 64
Roar Grønmo Avatar answered Dec 14 '25 20:12

Roar Grønmo


I encountered this error using the receive_sharing_intent package. Turns out the com.android.tools.build dependency was out of date.

Pull Request

Until that gets merged you can use this dependency statement:

receive_sharing_intent:
  git:
    url: https://github.com/Thogsit/receive_sharing_intent
like image 33
Joe Muller Avatar answered Dec 14 '25 19:12

Joe Muller