Recently I updated my Android Gradle Plugin to version 8.12.0 the upgrade was smooth and effortless all the project got upgraded to new Agp version no errors all good.
My project level Build.gradle file is looking a little bit awkward as I am seeing a strikethrough text on "compileSdk" and the summary stating that compileSdk is deprecated. It was strange because as I remember Google has shifted to "compileSdk" from "compileSdkVersion" which was deprecated some years ago.
There was no clear documentation on the Internet. Each time I found only is that "compileSdkVersion" deprecated and "compileSdk" is the new keyword to use.
android {
compileSdk 36
}
compileSdk showing a warning of deprecated in Android Studio Any suggestions please?
I was expecting "compileSdk" is the accepted keyword but it is showing as deprecated in the Agp version 8.12.0. Although the project is compiling and working
Here, Gradle Plugin update to version 8.13.0 dosn't help (java, build.gradle or build.gradke.kts, Narwhal 3 Feature Drop 2025 1.3). But the warning disappears if an = is added:
old, with warning:
compileSdk 36
new, warning disappears:
compileSdk = 36
Edit:
As AndroWeed notes below (thanks AndroWeed!), it works in build.gradle again with compileSdkVersion, see also buildToolsVersion and compileSdkVersion had been deprecated
In build.gradle.kts with libs.versions.toml, we can use:
compileSdkVersion(36)
or
compileSdk = 36
There seem to be several solutions...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With