I want to use architecture project (todo list) but get this error when i want to run project
The project is using an incompatible version (AGP 7.3.0-alpha07) of the Android Gradle plugin. Latest supported version is AGP 7.2.1
I want to use architecture project (todo list) but get this error when i want to run project
The project is using an incompatible version (AGP 7.3.0-alpha07) of the Android Gradle plugin. Latest supported version is AGP 7.2.1
Update to the latest version of Android Studio i.e. Dolphin and your problem will be resolved
Try either to upgrade Android Studio or change AGP version to the stable version like for example 7.2.1
in the project's build.gradle
file and sync the project:
buildscript {
//...
dependencies {
classpath 'com.android.tools.build:gradle:7.2.1'
// ...
}
}
You can refer to this table, that lists which version of Gradle is required for each version of the Android Gradle plugin.
Or this table that lists which version of the Android Gradle plugin is required for each version of Android Studio.
Instead of downgrading your AGP version in the accepted answer, you can update your android studio.
Update to the latest version of Android Studio i.e. Dolphin and your problem will be resolved
plugins {
id 'com.android.application' version '7.2.2' apply false
id 'com.android.library' version '7.2.2' apply false
id 'org.jetbrains.kotlin.android' version '1.7.10' apply false
}
In plugins change the version according to other projects use in your android studio check that and change according to them it will work.
My answer is going to help someone who was tired of new buggy Android Studio releases and decided to go back to a previous version of Android Studio but came into conflict with the new version of AGP (Android Gradle Plugin) being incompatible with the older version of Android Studio that you chose to use.
I rejected "Jellyfish" to opt for "Hedgehog", my current AGP version is 8.4.0, but Hedgehog's latest supported version is 8.2.2, as it says in the 'Build' tab:
The project is using an incompatible version (AGP 8.4.0) of the Android Gradle plugin. Latest supported version is AGP 8.2.2`
Follow these steps:
build.gradle
file.
You'll see something like this:androidApplication
by clicking on it with right mouse button → Go To → Declaration or Usages.libs.versions.toml
. Find the line with the attribute agp
and set it to the version number appropriate for your case (in the 'Build' tab, it suggested I use version 8.2.2, so I changed it from 8.4.0 to 8.2.2).buildscript {
ext.kotlinVersion = '1.6.10'
ext.navigationVersion = '2.4.2'
ext.ktlintVersion = '0.44.0'
ext.hiltVersion = '2.42'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$navigationVersion"
classpath "com.google.dagger:hilt-android-gradle-plugin:$hiltVersion"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Setting the versions in the top-level build.gradle as seen above, worked for me.
It is important to change the kotlinVersion as well!
Update your Android Studio to the latest Android Studio (Dolphin version) version.
dependencies { classpath 'com.android.tools.build:gradle:7.3.1' }
In the project grade file just change this from 7.4.2 or other newer version to whatever version you want.. Just sync the gradle file. And BOOM ... it will work ... Try again install it.
I also got this error when i updated android studio the error is gone and all things are working proper, So You Just Update Your Android Studio. In Mac keyboard cmd + , press -> Apprearance & Behaviour -> System Settings -> Updates -> Check for Updates -> Update Now
If you're using Gradle Kotlin DSL you can specify versions like you usually could:
alias(libs.plugins.android.application) version("8.3.1")
or
id("com.android.application") version("8.3.1")
No need to edit any toml files.
Solution worked for above issue for me :
while using KMP I was prompted to upgrade my AGP to version 8.3.0, after which I started getting the exact same error as the author of this post. I was able to resolve this issue, to do so follow the following steps:
check your android studio version, here is corresponding table.
Just uninstall your existing Android studio and Install a fresh latest available official version and this will work without any errors.
© 2022 - 2024 — McMap. All rights reserved.