Skip to content

Dependency updates and migration to AGP 9.1 / Gradle 9.4#13

Open
h-ideura wants to merge 1 commit into
mainfrom
update/update-dependencies-260409
Open

Dependency updates and migration to AGP 9.1 / Gradle 9.4#13
h-ideura wants to merge 1 commit into
mainfrom
update/update-dependencies-260409

Conversation

@h-ideura
Copy link
Copy Markdown
Collaborator

@h-ideura h-ideura commented Apr 13, 2026

Overview

Updated project-wide dependencies to their latest versions and upgraded to Android Gradle Plugin (AGP) 9.1.0 and Gradle 9.4.1. This migration includes resolving compatibility issues with the latest build environments and preparing for the future Kotlin Multiplatform (KMP) recommended configurations.

Changes

1. Library and Tooling Updates

Upgraded major toolchains and libraries to their latest stable (including early adopter) versions.

  • Kotlin: 2.3.20
  • Gradle: 9.4.1
  • Android Gradle Plugin (AGP): 9.1.0
  • Coroutines: 1.10.2
  • Essenty: 2.5.0
  • Testing: Kotest 6.1.11, Turbine 1.2.1, AndroidX Test 1.7.0
  • Static Analysis: KtLint 14.2.0, Kover 0.9.8

2. AGP 9.0 Compatibility (gradle.properties)

Starting with AGP 9.0, the combination of the traditional com.android.library and kotlin-multiplatform plugins is restricted. The following flags have been introduced to maintain the build:

  • android.builtInKotlin=false
  • android.newDsl=false
    Note: This is a temporary workaround. A long-term migration to the new KMP-specific Android plugin is planned.

Implementation Intent and Background

Why upgrade to Gradle 9 / AGP 9?

To leverage the new features of Kotlin 2.3 and AGP 9 (such as build performance improvements and new DSLs) and to ensure the project remains maintainable with modern standards.

Handling Platform-Specific DSLs (buildTypes, testOptions, packagingOptions)

The following design principles have been applied during this update:

  • Separation of Concerns: KMP shared modules should focus on pure logic. Complex Android-specific configurations like buildTypes (debug/release setups) or packagingOptions (duplicate file exclusion during APK generation) should be centralized in the final application (App module) side.
  • Alignment with KMP Standards: The future official KMP plugin (com.android.kotlin.multiplatform.library) will not support many of these Android-specific DSLs. By removing or reducing reliance on them now, we aim for a simpler and more standard module structure.

Verification

  • Verified that Gradle Sync completes successfully.
  • Verified that ./gradlew assemble runs without errors.
  • Verified that ./gradlew help and module builds pass without errors.

@h-ideura h-ideura changed the title 依存関係の最新化および AGP 9.1 / Gradle 9.4 へのマイグレーション Dependency updates and migration to AGP 9.1 / Gradle 9.4 Apr 13, 2026
Comment thread config/deps.versions.toml
Comment on lines +2 to +14
kotlin = "2.3.20"
coroutines = "1.10.2"
essenty = "2.5.0"
androidxTest = "1.7.0"
androidxJunit = "1.3.0"
turbine = "1.2.1"
kotest = "6.1.11"
kover = "0.9.8"
kermit = "2.1.0"
ktLint = "14.2.0"
dokka = "2.2.0"
# Android
android-gradle = "8.5.2"
android-gradle = "9.1.0"
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4/9時点での最新依存関係です

jvmTarget = Config.javaVersion.toString()
freeCompilerArgs = listOf(
tasks.withType<KotlinCompile>().configureEach {
compilerOptions {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kotlinOptionsはdeprecatedになりました

Comment thread .idea/compiler.xml
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="17" />
<bytecodeTargetLevel target="21" />
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kotlinのバージョンアップに伴いJavaバージョンもあげ

@h-ideura h-ideura requested a review from wasabi-muffin April 13, 2026 05:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant