Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
Ask Question
I tried cloning and building this project,
https://github.com/mitrejcevski/ui-testing
, but upon opening it in Android Studio, I get the following build error:
ERROR: The Android Gradle plugin supports only Kotlin Gradle plugin version 1.3.0 and higher.
The following dependencies do not satisfy the required version:
root project 'ui-testing' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.21
Affected Modules: app
However, when I click the 'app' hyperlink I am led to the module-level build.gradle
file, which reads
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 27
defaultConfig {
applicationId "nl.jovmit"
minSdkVersion 19
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
productFlavors {
mock {
flavorDimensions "default"
prod {
flavorDimensions "default"
android.variantFilter { variant ->
if (variant.buildType.name == 'release' && variant.getFlavors().get(0).name == 'mock') {
variant.setIgnore(true)
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation "com.android.support:appcompat-v7:$support_version"
implementation "com.android.support:design:$support_version"
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.21'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
testImplementation 'junit:junit:4.12'
Unlike the accepted answer of ERROR: The Android Gradle plugin supports only Kotlin Gradle plugin version 1.3.0 and higher, I don't see any ext.kotlin_version
anywhere in the Gradle file.
I do see this warning, though, that kotlin-stdlib-jre7
is deprecated:
However, I tried changing this but still get the same error. I've also tried adding the line
implementation 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.21'
to dependencies
(as seen in the screenshot above), but that also didn't prevent the error.
Any idea how to fix this? I suspect that the outdated Kotlin version is a 'sub-dependency' of one of the dependencies here, but haven't been able to figure out which one.
–
–
dependencies {
classpath "com.android.tools.build:gradle:$android_plugin_version"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Go to Tools > SDK Manager > Kotlin
Install new plugin version
Make sure your project level build.gradle looks as the one below
buildscript {
ext.kotlin_version = '1.3.10' //put the version you just updated to
repositories {
google()
jcenter()
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
dependencies {
classpath 'com.android.tools.build:gradle:3.4.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
allprojects {
repositories {
google()
jcenter()
task clean(type: Delete) {
delete rootProject.buildDir
ext {
roomVersion = '1.0.0'
archLifecycleVersion = '1.1.0'
Then in app level build.gradle, I updated my dependencies to have this:
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
I built, and everything worked fine again.
2022 Solution for "Your project requires a newer version of the Kotlin Gradle plugin"
In order to build a Kotlin project with Gradle, you should apply the Kotlin Gradle plugin to your project and configure the dependencies.
In your root Project then Android/build.gradle
buildscript {
ext.kotlin_version = '1.5.31'
repositories {
google()
mavenCentral()
dependencies {
classpath 'com.android.tools.build:gradle:4.2.2'
classpath 'com.google.gms:google-services:4.3.10'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31'
//$kotlin_version removed it to 1.5.31
allprojects {
repositories {
google()
mavenCentral()
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
project.evaluationDependsOn(':app')
task clean(type: Delete) {
delete rootProject.buildDir
update your project level build.gradle
ext.kotlin_version = 'your_current_version' to ext.kotlin_version = '1.6.10'
You can access last version => https://kotlinlang.org/docs/gradle.html#targeting-the-jvm
Make Sure you've added ext.kotlin_version = '1.6.0'
and classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
to Project/build.gradle and also enable multiDexEnabled true
in app/build.gradle
defaultConfig {
multiDexEnabled true
buildscript {
ext.kotlin_version = '1.6.0'
repositories {
google()
jcenter()
dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
allprojects {
repositories {
google()
jcenter()
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
subprojects {
project.evaluationDependsOn(':app')
task clean(type: Delete) {
delete rootProject.buildDir
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.