Fix tables layout

This commit is contained in:
Ilya Evtushenko
2026-03-26 18:30:33 +01:00
committed by Yahor Berdnikau
parent 43f47714e1
commit 08f62af670
3 changed files with 124 additions and 124 deletions
@@ -6,21 +6,21 @@ Side-by-side mapping of every DSL element from the old `com.android.library` con
## Plugin IDs
| Old (AGP 8.x) | New (AGP 9.x) |
|---|---|
| `com.android.library` | `com.android.kotlin.multiplatform.library` |
| `com.android.application` | `com.android.application` (unchanged, but cannot combine with KMP) |
| `org.jetbrains.kotlin.android` | Built into `com.android.application` and `com.android.library` in AGP 9.0 (do not apply separately) |
| `org.jetbrains.kotlin.kapt` | `com.android.legacy-kapt` (same version as AGP) or migrate to KSP |
| `org.jetbrains.kotlin.multiplatform` | `org.jetbrains.kotlin.multiplatform` (unchanged) |
| Old (AGP 8.x) | New (AGP 9.x) |
|--------------------------------------|-----------------------------------------------------------------------------------------------------|
| `com.android.library` | `com.android.kotlin.multiplatform.library` |
| `com.android.application` | `com.android.application` (unchanged, but cannot combine with KMP) |
| `org.jetbrains.kotlin.android` | Built into `com.android.application` and `com.android.library` in AGP 9.0 (do not apply separately) |
| `org.jetbrains.kotlin.kapt` | `com.android.legacy-kapt` (same version as AGP) or migrate to KSP |
| `org.jetbrains.kotlin.multiplatform` | `org.jetbrains.kotlin.multiplatform` (unchanged) |
---
## Top-Level Block Migration
| Old | New |
|---|---|
| `android { ... }` | `kotlin { android { ... } }` |
| Old | New |
|-------------------------------------------|-------------------------------------|
| `android { ... }` | `kotlin { android { ... } }` |
| `androidTarget { ... }` (in kotlin block) | `android { ... }` (in kotlin block) |
---
@@ -29,36 +29,36 @@ Side-by-side mapping of every DSL element from the old `com.android.library` con
### Namespace and SDK Versions
| Old (android {}) | New (kotlin { android {} }) |
|---|---|
| `namespace = "..."` | `namespace = "..."` |
| `compileSdk = 35` | `compileSdk = 35` (same value, just moved into `kotlin { android {} }`) |
| `defaultConfig { minSdk = 24 }` | `minSdk = 24` |
| `defaultConfig { targetSdk = 34 }` | N/A (application-only, not in library) |
| Old (android {}) | New (kotlin { android {} }) |
|------------------------------------|-------------------------------------------------------------------------|
| `namespace = "..."` | `namespace = "..."` |
| `compileSdk = 35` | `compileSdk = 35` (same value, just moved into `kotlin { android {} }`) |
| `defaultConfig { minSdk = 24 }` | `minSdk = 24` |
| `defaultConfig { targetSdk = 34 }` | N/A (application-only, not in library) |
### defaultConfig Elements
| Old (android { defaultConfig {} }) | New (kotlin { android {} }) |
|---|---|
| `minSdk = 24` | `minSdk = 24` (direct property) |
| `testInstrumentationRunner = "..."` | Set in `withDeviceTest { }` configuration |
| `consumerProguardFiles("...")` | `consumerProguardFiles.add(file("..."))` |
| `multiDexEnabled = true` | N/A (handled automatically) |
| `vectorDrawables.useSupportLibrary = true` | N/A |
| `buildConfigField(...)` | Removed (see KNOWN-ISSUES.md) |
| `manifestPlaceholders[...]` | N/A (use merged manifest in app module) |
| Old (android { defaultConfig {} }) | New (kotlin { android {} }) |
|--------------------------------------------|-------------------------------------------|
| `minSdk = 24` | `minSdk = 24` (direct property) |
| `testInstrumentationRunner = "..."` | Set in `withDeviceTest { }` configuration |
| `consumerProguardFiles("...")` | `consumerProguardFiles.add(file("..."))` |
| `multiDexEnabled = true` | N/A (handled automatically) |
| `vectorDrawables.useSupportLibrary = true` | N/A |
| `buildConfigField(...)` | Removed (see KNOWN-ISSUES.md) |
| `manifestPlaceholders[...]` | N/A (use merged manifest in app module) |
---
## Compile Options and Compiler Options
| Old | New |
|---|---|
| Old | New |
|-------------------------------------------------------------------------------|------------------------------------------------------------------------------|
| `android { compileOptions { sourceCompatibility = JavaVersion.VERSION_11 } }` | `kotlin { android { compilerOptions { jvmTarget.set(JvmTarget.JVM_11) } } }` |
| `android { compileOptions { targetCompatibility = JavaVersion.VERSION_11 } }` | `kotlin { android { compilerOptions { jvmTarget.set(JvmTarget.JVM_11) } } }` |
| `kotlinOptions { jvmTarget = "11" }` | `compilerOptions { jvmTarget.set(JvmTarget.JVM_11) }` |
| `kotlinOptions { freeCompilerArgs += listOf("-Xopt-in=...") }` | `compilerOptions { optIn.add("...") }` |
| `kotlinOptions { languageVersion = "1.9" }` | `compilerOptions { languageVersion.set(KotlinVersion.KOTLIN_2_0) }` |
| `kotlinOptions { jvmTarget = "11" }` | `compilerOptions { jvmTarget.set(JvmTarget.JVM_11) }` |
| `kotlinOptions { freeCompilerArgs += listOf("-Xopt-in=...") }` | `compilerOptions { optIn.add("...") }` |
| `kotlinOptions { languageVersion = "1.9" }` | `compilerOptions { languageVersion.set(KotlinVersion.KOTLIN_2_0) }` |
Full JvmTarget import:
```kotlin
@@ -69,39 +69,39 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget
## Build Features
| Old (android { buildFeatures {} }) | New (kotlin { android {} }) |
|---|---|
| `buildFeatures { compose = true }` | Applied via compose compiler plugin (no explicit flag needed in KMP library) |
| `buildFeatures { buildConfig = true }` | Removed in KMP library (see KNOWN-ISSUES.md) |
| `buildFeatures { viewBinding = true }` | Not supported in KMP library |
| `buildFeatures { dataBinding = true }` | Not supported in KMP library |
| `buildFeatures { aidl = true }` | Not supported in KMP library |
| `buildFeatures { renderScript = true }` | Not supported |
| `buildFeatures { resValues = true }` | Not supported in KMP library |
| Old (android { buildFeatures {} }) | New (kotlin { android {} }) |
|-----------------------------------------|------------------------------------------------------------------------------|
| `buildFeatures { compose = true }` | Applied via compose compiler plugin (no explicit flag needed in KMP library) |
| `buildFeatures { buildConfig = true }` | Removed in KMP library (see KNOWN-ISSUES.md) |
| `buildFeatures { viewBinding = true }` | Not supported in KMP library |
| `buildFeatures { dataBinding = true }` | Not supported in KMP library |
| `buildFeatures { aidl = true }` | Not supported in KMP library |
| `buildFeatures { renderScript = true }` | Not supported |
| `buildFeatures { resValues = true }` | Not supported in KMP library |
---
## Android Resources
| Old | New |
|---|---|
| Resources processed by default | Must explicitly enable |
| Old | New |
|---------------------------------------------|-------------------------------------------------------------|
| Resources processed by default | Must explicitly enable |
| `android { ... }` (resources auto-included) | `kotlin { android { androidResources { enable = true } } }` |
---
## Test Options
| Old | New |
|---|---|
| `android { testOptions { unitTests.isReturnDefaultValues = true } }` | `kotlin { android { withHostTest { } } }` |
| `android { testOptions { animationsDisabled = true } }` | `kotlin { android { withDeviceTest { } } }` |
| Source set: `androidUnitTest` | Source set: `androidHostTest` (alias: `androidUnitTest` still works) |
| Source set: `androidInstrumentedTest` | Source set: `androidDeviceTest` (alias: `androidInstrumentedTest` still works) |
| `testImplementation(...)` | `androidHostTest.dependencies { implementation(...) }` |
| `androidTestImplementation(...)` | `androidDeviceTest.dependencies { implementation(...) }` |
| Source dir: `src/test/` | Source dir: `src/androidHostTest/kotlin/` |
| Source dir: `src/androidTest/` | Source dir: `src/androidDeviceTest/kotlin/` |
| Old | New |
|----------------------------------------------------------------------|--------------------------------------------------------------------------------|
| `android { testOptions { unitTests.isReturnDefaultValues = true } }` | `kotlin { android { withHostTest { } } }` |
| `android { testOptions { animationsDisabled = true } }` | `kotlin { android { withDeviceTest { } } }` |
| Source set: `androidUnitTest` | Source set: `androidHostTest` (alias: `androidUnitTest` still works) |
| Source set: `androidInstrumentedTest` | Source set: `androidDeviceTest` (alias: `androidInstrumentedTest` still works) |
| `testImplementation(...)` | `androidHostTest.dependencies { implementation(...) }` |
| `androidTestImplementation(...)` | `androidDeviceTest.dependencies { implementation(...) }` |
| Source dir: `src/test/` | Source dir: `src/androidHostTest/kotlin/` |
| Source dir: `src/androidTest/` | Source dir: `src/androidDeviceTest/kotlin/` |
### Test Configuration Details
@@ -136,11 +136,11 @@ kotlin {
## Lint Configuration
| Old | New |
|---|---|
| `android { lint { abortOnError = false } }` | `kotlin { android { lint { abortOnError = false } } }` |
| `android { lint { checkReleaseBuilds = true } }` | `kotlin { android { lint { checkReleaseBuilds = true } } }` |
| `android { lint { disable += "SomeCheck" } }` | `kotlin { android { lint { disable += "SomeCheck" } } }` |
| Old | New |
|-------------------------------------------------------------|------------------------------------------------------------------------|
| `android { lint { abortOnError = false } }` | `kotlin { android { lint { abortOnError = false } } }` |
| `android { lint { checkReleaseBuilds = true } }` | `kotlin { android { lint { checkReleaseBuilds = true } } }` |
| `android { lint { disable += "SomeCheck" } }` | `kotlin { android { lint { disable += "SomeCheck" } } }` |
| `android { lint { baseline = file("lint-baseline.xml") } }` | `kotlin { android { lint { baseline = file("lint-baseline.xml") } } }` |
The lint DSL is largely unchanged, it just moves inside `kotlin { android {} }`.
@@ -151,8 +151,8 @@ The lint DSL is largely unchanged, it just moves inside `kotlin { android {} }`.
## Packaging / Resources Excludes
| Old | New |
|---|---|
| Old | New |
|-----------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------|
| `android { packaging { resources { excludes += "/META-INF/{AL2.0,LGPL2.1}" } } }` | `kotlin { android { packaging { resources { excludes += "/META-INF/{AL2.0,LGPL2.1}" } } } }` |
The DSL is the same, just nested under `kotlin { android {} }`.
@@ -173,17 +173,17 @@ resources {
## Dependencies Configurations
| Old Configuration | New Configuration | Notes |
|---|---|---|
| `implementation(...)` | `androidMain.dependencies { implementation(...) }` | Move to source set |
| `api(...)` | `androidMain.dependencies { api(...) }` | Move to source set |
| `compileOnly(...)` | `androidMain.dependencies { compileOnly(...) }` | Move to source set |
| `debugImplementation(...)` | `"androidRuntimeClasspath"(...)` | No variant-specific configs |
| `releaseImplementation(...)` | `androidMain.dependencies { implementation(...) }` | Single variant |
| `testImplementation(...)` | `androidHostTest.dependencies { implementation(...) }` | |
| `androidTestImplementation(...)` | `androidDeviceTest.dependencies { implementation(...) }` | |
| `ksp(...)` | `add("ksp", ...)` or KSP Gradle plugin DSL | Check KSP compatibility |
| `kapt(...)` | Migrate to KSP; kapt not supported | |
| Old Configuration | New Configuration | Notes |
|----------------------------------|----------------------------------------------------------|-----------------------------|
| `implementation(...)` | `androidMain.dependencies { implementation(...) }` | Move to source set |
| `api(...)` | `androidMain.dependencies { api(...) }` | Move to source set |
| `compileOnly(...)` | `androidMain.dependencies { compileOnly(...) }` | Move to source set |
| `debugImplementation(...)` | `"androidRuntimeClasspath"(...)` | No variant-specific configs |
| `releaseImplementation(...)` | `androidMain.dependencies { implementation(...) }` | Single variant |
| `testImplementation(...)` | `androidHostTest.dependencies { implementation(...) }` | |
| `androidTestImplementation(...)` | `androidDeviceTest.dependencies { implementation(...) }` | |
| `ksp(...)` | `add("ksp", ...)` or KSP Gradle plugin DSL | Check KSP compatibility |
| `kapt(...)` | Migrate to KSP; kapt not supported | |
---
@@ -200,12 +200,12 @@ Because the new KMP Android library plugin is strictly single-variant, you can n
**Removed in KMP library plugin.** The `com.android.kotlin.multiplatform.library` plugin produces a single build variant.
| Old | New | Notes |
|---|---|---|
| `buildTypes { debug { ... } }` | Removed | Single variant only |
| `buildTypes { release { minifyEnabled = true } }` | Removed | Minification is app-module concern |
| `productFlavors { ... }` | Removed | Use Gradle properties or expect/actual for variants |
| `flavorDimensions(...)` | Removed | |
| Old | New | Notes |
|---------------------------------------------------|---------|-----------------------------------------------------|
| `buildTypes { debug { ... } }` | Removed | Single variant only |
| `buildTypes { release { minifyEnabled = true } }` | Removed | Minification is app-module concern |
| `productFlavors { ... }` | Removed | Use Gradle properties or expect/actual for variants |
| `flavorDimensions(...)` | Removed | |
### Workarounds for Variant-Dependent Logic
@@ -218,11 +218,11 @@ Because the new KMP Android library plugin is strictly single-variant, you can n
## androidComponents Block
| Old | New |
|---|---|
| `androidComponents { onVariants { ... } }` | Limited support; most variant API is unavailable |
| `androidComponents { beforeVariants { ... } }` | Not available in KMP library |
| `androidComponents { finalizeDsl { ... } }` | Not available in KMP library |
| Old | New |
|------------------------------------------------|--------------------------------------------------|
| `androidComponents { onVariants { ... } }` | Limited support; most variant API is unavailable |
| `androidComponents { beforeVariants { ... } }` | Not available in KMP library |
| `androidComponents { finalizeDsl { ... } }` | Not available in KMP library |
The `androidComponents` extension is significantly reduced in scope for KMP libraries because there is only a single variant. Most customization that relied on variant-aware APIs must be reworked.
@@ -232,10 +232,10 @@ The `androidComponents` extension is significantly reduced in scope for KMP libr
## Java Source Compilation
| Old | New |
|---|---|
| Java sources in `src/main/java/` compiled automatically | Must call `withJava()` |
| `android { compileOptions { ... } }` | `kotlin { android { withJava() } }` |
| Old | New |
|---------------------------------------------------------|-------------------------------------|
| Java sources in `src/main/java/` compiled automatically | Must call `withJava()` |
| `android { compileOptions { ... } }` | `kotlin { android { withJava() } }` |
```kotlin
kotlin {
@@ -202,22 +202,22 @@ No other root-level changes are required unless you have convention plugins that
The new KMP-integrated plugin does NOT change the expected source directory layout. The standard KMP source sets still apply:
| Source Set | Directory |
|---|---|
| `commonMain` | `src/commonMain/kotlin/` |
| `androidMain` | `src/androidMain/kotlin/` |
| `androidMain` resources | `src/androidMain/res/` |
| `iosMain` | `src/iosMain/kotlin/` |
| Source Set | Directory |
|-------------------------|---------------------------|
| `commonMain` | `src/commonMain/kotlin/` |
| `androidMain` | `src/androidMain/kotlin/` |
| `androidMain` resources | `src/androidMain/res/` |
| `iosMain` | `src/iosMain/kotlin/` |
**No renames are required** if you already use the standard KMP layout. If your module previously used the classic Android layout (`src/main/java/`, `src/main/res/`), you must migrate to the KMP layout:
| Old (Android layout) | New (KMP layout) |
|---|---|
| `src/main/java/` | `src/androidMain/kotlin/` |
| `src/main/res/` | `src/androidMain/res/` |
| `src/main/AndroidManifest.xml` | `src/androidMain/AndroidManifest.xml` |
| `src/test/java/` | `src/androidHostTest/kotlin/` (or `src/androidUnitTest/kotlin/`) |
| `src/androidTest/java/` | `src/androidDeviceTest/kotlin/` (or `src/androidInstrumentedTest/kotlin/`) |
| Old (Android layout) | New (KMP layout) |
|--------------------------------|----------------------------------------------------------------------------|
| `src/main/java/` | `src/androidMain/kotlin/` |
| `src/main/res/` | `src/androidMain/res/` |
| `src/main/AndroidManifest.xml` | `src/androidMain/AndroidManifest.xml` |
| `src/test/java/` | `src/androidHostTest/kotlin/` (or `src/androidUnitTest/kotlin/`) |
| `src/androidTest/java/` | `src/androidDeviceTest/kotlin/` (or `src/androidInstrumentedTest/kotlin/`) |
---
@@ -7,16 +7,16 @@ which plugins the project uses and whether they are compatible.**
## Known Compatible Plugins (minimum version required)
| Plugin | Minimum Compatible Version | Notes |
|--------|---------------------------|-------|
| `com.google.devtools.ksp` | 2.3.1 (2.3.3+ recommended) | 2.3.1 adds AGP 9.0 support; 2.3.3+ fixes deprecated compilerOptions KGP API usage. May need `android.disallowKotlinSourceSets=false` |
| `com.google.dagger.hilt.android` | 2.59 | — |
| `com.google.firebase.firebase-perf` | 2.0.2 | — |
| `androidx.navigation.safeargs` | 2.9.5 | — |
| `org.jetbrains.compose` | 1.9.3 | — |
| `org.jetbrains.dokka` | 2.2.0-Beta | — |
| `app.cash.burst` | 2.10.0 | — |
| `com.google.firebase.testlab` | 0.0.1-alpha11 | — |
| Plugin | Minimum Compatible Version | Notes |
|-------------------------------------|----------------------------|--------------------------------------------------------------------------------------------------------------------------------------|
| `com.google.devtools.ksp` | 2.3.1 (2.3.3+ recommended) | 2.3.1 adds AGP 9.0 support; 2.3.3+ fixes deprecated compilerOptions KGP API usage. May need `android.disallowKotlinSourceSets=false` |
| `com.google.dagger.hilt.android` | 2.59 | — |
| `com.google.firebase.firebase-perf` | 2.0.2 | — |
| `androidx.navigation.safeargs` | 2.9.5 | — |
| `org.jetbrains.compose` | 1.9.3 | — |
| `org.jetbrains.dokka` | 2.2.0-Beta | — |
| `app.cash.burst` | 2.10.0 | — |
| `com.google.firebase.testlab` | 0.0.1-alpha11 | — |
---
@@ -24,29 +24,29 @@ which plugins the project uses and whether they are compatible.**
These work but require temporarily setting `android.newDsl=false` (or other flags):
| Plugin | Workaround |
|--------|-----------|
| `androidx.baselineprofile` (< 1.5.0-alpha01) | `android.newDsl=false` |
| `de.mannodermaus.android-junit5` (< 1.13.4.0) | `android.newDsl=false` |
| `com.google.android.gms:oss-licenses-plugin` (< 0.10.8) | `android.newDsl=false` |
| `com.apollographql.apollo` (< 4.4.0) | `android.newDsl=false` |
| `org.gradle.android.cache-fix` (< 3.0.2) | `android.newDsl=false` |
| `com.github.triplet.play` (< 4.0.0) | `android.newDsl=false` |
| `app.cash.sqldelight` | `android.newDsl=false` + `android.disallowKotlinSourceSets=false` |
| `com.google.protobuf` | `android.newDsl=false` |
| `app.cash.paparazzi` | `android.newDsl=false` |
| `io.gitlab.arturbosch.detekt` (< 2.0.0) | `android.newDsl=false` + `android.builtInKotlin=false` |
| `org.jlleitschuh.gradle.ktlint` | `android.builtInKotlin=false` |
| Plugin | Workaround |
|---------------------------------------------------------|-----------------------------------------------------------------------------------------------------|
| `androidx.baselineprofile` (< 1.5.0-alpha01) | `android.newDsl=false` |
| `de.mannodermaus.android-junit5` (< 1.13.4.0) | `android.newDsl=false` |
| `com.google.android.gms:oss-licenses-plugin` (< 0.10.8) | `android.newDsl=false` |
| `com.apollographql.apollo` (< 4.4.0) | `android.newDsl=false` |
| `org.gradle.android.cache-fix` (< 3.0.2) | `android.newDsl=false` |
| `com.github.triplet.play` (< 4.0.0) | `android.newDsl=false` |
| `app.cash.sqldelight` | `android.newDsl=false` + `android.disallowKotlinSourceSets=false` |
| `com.google.protobuf` | `android.newDsl=false` |
| `app.cash.paparazzi` | `android.newDsl=false` |
| `io.gitlab.arturbosch.detekt` (< 2.0.0) | `android.newDsl=false` + `android.builtInKotlin=false` |
| `org.jlleitschuh.gradle.ktlint` | `android.builtInKotlin=false` |
| `dev.icerock.mobile.multiplatform-resources` (< 0.26.0) | `android.builtInKotlin=false` + `android.newDsl=false` + `android.sourceset.disallowProvider=false` |
---
## Known Broken Plugins (No Workaround)
| Plugin | Status |
|--------|--------|
| Plugin | Status |
|------------------------------|---------------------------|
| `com.newrelic.agent.android` | Incompatible with AGP 9.0 |
| `com.huawei.agconnect.agcp` | Incompatible with AGP 9.0 |
| `com.huawei.agconnect.agcp` | Incompatible with AGP 9.0 |
---