Android AGP 8.x.x -> 9.0.0 Deprecations / Config Changes
Otter 3 Project Config
Just a short post for those upgrading their Android project/s.With the release of Android Studio Otter 3 on January 15th, we also got an AGP upgrade to 9.0.0
Important Note
✨ AI Blog Post Summary
- Built-in Kotlin Support: AGP 9.0 now has native Kotlin support. You no longer need to apply the kotlin-android plugin; instead, you should remove it to avoid conflicts.
- New Android-KMP Plugin: A new, specialized plugin (com.android.kotlin.multiplatform.library) is introduced for KMP library modules. This replaces the old way of applying the android-library plugin alongside KMP.
- Module Restructuring: To avoid plugin conflicts, it is recommended to extract the Android-specific app entry point into its own separate module (e.g., :androidApp), while keeping shared logic in a KMP library module.
- Removal of Build Types in KMP: A major breaking change is that build types (like debug and release) are no longer supported directly within KMP library modules. This affects BuildConfig and manifest placeholders, requiring developers to refactor how they handle build-specific logic (e.g., using Dependency Injection).
- Configuration Changes: The android.kotlinOptions and kotlin.sourceSets DSLs require updates or migration to the new AGP 9.0 structure.
In short, the guide warns that while the migration simplifies the build setup in the long run, it requires significant refactoring of how Android-specific KMP code and build configurations are handled.
Deprecations
Updating to this will give you a bunch of deprecation warnings:In this case, I'm updating from "8.13.2" to "9.0.0".
It does warn you about these during the upgrade process.
It will also remind you again after the upgrade is complete:
Changes
So I'll quickly note what we should do to get rid of the warnings when you build/run your project:build.gradle.kts plugins
From project, comment out / remove this:
alias(libs.plugins.android.application) apply false
// alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.compose) apply false
From app, comment out / remove this:
alias(libs.plugins.android.application)
// alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.compose)
gradle.properties
We can remove all of these I have commented out:
android.nonTransitiveRClass=true
#android.defaults.buildfeatures.resvalues=true
#android.sdk.defaultTargetSdkToCompileSdkIfUnset=false
#android.enableAppCompileTimeRClass=false
#android.usesSdkInManifest.disallowed=false
android.uniquePackageNames=false
android.dependency.useConstraints=true
android.r8.strictFullModeForKeepRules=false
#android.r8.optimizedResourceShrinking=false
#android.builtInKotlin=false
#android.newDsl=false
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
android.useAndroidX=true
kotlin.code.style=official
android.nonTransitiveRClass=true
libs.versions.toml
We can remove the kotlin-android as this is now in all projects by default.
[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
#kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
Other Points of Interest
gradle-wrapper.properties
We can upgrade our gradle version to 9.3:
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.0-bin.zip
Creating a new project, I noticed it added a new value to my config - distributionSha256Sum. I haven't looked into this yet, but I think it's good to point this out.
#Tue Jan 20 19:57:52 JST 2026
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
build.gradle.kts
Still defaults to Java 11. I have been using Java 21 for most of my projects for a while now with no apparent issues. This should, hopefully, provide some performance benefits. I've not looked too deeply in to this.
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
I also remove buildFeatures compose as I haven't found a reason to keep this:
compileOptions {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
// buildFeatures {
// compose = true
// }
Comments
Post a Comment