Skip to content

fix: remove Kotlin Android plugin from Android samples for AGP 9 - #425

Merged
avner-m merged 1 commit into
masterfrom
fix/android-agp9-builtin-kotlin
Dec 1, 2026
Merged

avner-m merged 1 commit into
masterfrom
fix/android-agp9-builtin-kotlin

Conversation

@avner-m

@avner-m avner-m commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Summary

The three Android tutorial sample apps fail Gradle sync in Android Studio:

Failed to apply plugin 'org.jetbrains.kotlin.android'
The 'org.jetbrains.kotlin.android' plugin is no longer required for Kotlin support since AGP 9.0.
Solution: Remove the 'org.jetbrains.kotlin.android' plugin from this project's build file: app/build.gradle.kts.

The samples were bumped to AGP 9.x (now 9.5.3) by Dependabot. AGP 9 has built-in Kotlin support and rejects the separate Kotlin Android plugin, so anyone following the Android SDK quickstarts cannot open the starter project.

Changes

Applied to android-holder-tutorial-sample-app, android-remote-verification-tutorial-sample-app and android-in-person-verifier-tutorial-sample-app:

  • Removed org.jetbrains.kotlin.android from the root and app plugins blocks and from libs.versions.toml.
  • Replaced android { kotlinOptions { jvmTarget = "11" } }, which came from the removed plugin, with a top-level kotlin { compilerOptions { jvmTarget.set(JvmTarget.JVM_11) } }.

See https://kotl.in/gradle/agp-built-in-kotlin for the migration guidance.

Testing

  • All three apps now pass Gradle configuration (./gradlew :app:dependencies --configuration debugCompileClasspath, JDK 21 from Android Studio).
  • A full compile was not run because the MATTR SDK artifacts are not committed to repo/, and resolving them is a tutorial step.
  • Opening these projects requires an Android Studio release that supports AGP 9.5.x. Older Android Studio versions report "Latest supported version is AGP 9.0.0".

🤖 Generated with Claude Code

AGP 9 has built-in Kotlin support and fails project sync when
org.jetbrains.kotlin.android is also applied. Remove the plugin from
the three Android tutorial samples and move jvmTarget from the
removed kotlinOptions block to kotlin.compilerOptions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@avner-m
avner-m requested a review from a team as a code owner December 1, 2026 21:47
@avner-m
avner-m merged commit fb2f76e into master Dec 1, 2026
4 checks passed
@avner-m
avner-m deleted the fix/android-agp9-builtin-kotlin branch December 1, 2026 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants