Skip to content

Migrate to built-in Kotlin#22

Open
ubxty wants to merge 1 commit into
vespr-wallet:masterfrom
ubxty:migrate-to-built-in-kotlin
Open

Migrate to built-in Kotlin#22
ubxty wants to merge 1 commit into
vespr-wallet:masterfrom
ubxty:migrate-to-built-in-kotlin

Conversation

@ubxty

@ubxty ubxty commented Jun 8, 2026

Copy link
Copy Markdown

Migrates the plugin to use built-in Kotlin per the official Flutter
migration guide:
https://docs.flutter.dev/release/breaking-changes/migrate-to-built-in-kotlin/for-plugin-authors

AGP 9.0 will remove support for plugins that apply the Kotlin Gradle
Plugin. This PR removes the legacy apply plugin: "kotlin-android"
line and the KGP classpath from android/build.gradle, and the same
from the example app's example/android/app/build.gradle.

The example app builds cleanly with flutter build apk --debug on
Flutter 3.44.1 with no KGP deprecation warnings.

Bumps the minimum Flutter version to 3.44.0 and Dart SDK to 3.12.0,
as required by the new kotlin.compilerOptions DSL.

Fixes the warning: "Your app uses the following plugins that apply
Kotlin Gradle Plugin (KGP)".

Summary by CodeRabbit

Release Notes - Version 2.2.0

  • Chores

    • Released version 2.2.0.
    • Updated minimum Dart version requirement to 3.12.0 and Flutter version to 3.44.0.
    • Modernized the Android build system for improved compatibility with current development standards.
  • Documentation

    • Updated CHANGELOG with version 2.2.0 release information.

Removes the legacy kotlin-android plugin apply and the Kotlin Gradle
Plugin classpath from android/build.gradle, per the official Flutter
migration guide at:
  https://docs.flutter.dev/release/breaking-changes/migrate-to-built-in-kotlin/for-plugin-authors

Also migrates the example app (example/android/app/build.gradle and
example/android/gradle.properties).

Builds cleanly with flutter build apk --debug in the example app, no
Kotlin Gradle Plugin deprecation warnings.

Bumps minimum Flutter version to 3.44.0 and Dart SDK to 3.12.0 as
required by the new compilerOptions DSL.
@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR releases version 2.2.0, which migrates the Kotlin build configuration to use AGP 9.0's built-in Kotlin support instead of the legacy Kotlin Gradle plugin. It raises minimum Dart/Flutter SDK versions, updates the library and example app build configurations, and increases JVM heap allocation in the example app.

Changes

Kotlin/AGP 9.0 Migration and v2.2.0 Release

Layer / File(s) Summary
Version and SDK constraints update
pubspec.yaml
Package version updated to 2.2.0; Dart SDK constraint raised to ^3.12.0 and Flutter SDK constraint raised to >=3.44.0.
Library module Kotlin/AGP 9.0 migration
android/build.gradle
Buildscript removes Kotlin version definition and Gradle plugin classpath; plugins block removes kotlin-android plugin; android/kotlinOptions configuration removed and replaced with top-level kotlin { compilerOptions { jvmTarget = JVM_17 } } block; Kotlin stdlib dependency removed.
Example app Kotlin/AGP 9.0 and Gradle property updates
example/android/app/build.gradle, example/android/gradle.properties
Example app plugins block removes kotlin-android plugin and adds kotlin { compilerOptions { jvmTarget = JVM_17 } } configuration; gradle.properties increases JVM max heap to -Xmx8G, adds metaspace and code cache settings, and enables android.builtInKotlin=true and android.newDsl=true flags.
Release documentation
CHANGELOG.md
Release notes document built-in Kotlin/AGP 9.0 migration, updated SDK requirements, and example app Gradle property changes.

🎯 2 (Simple) | ⏱️ ~12 minutes

🐰 Version 2.2.0 hops into place,
Kotlin built-in sets the pace,
AGP 9 brings new grace,
SDK constraints embrace,
Gradle flags in their base.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: migrating to built-in Kotlin instead of relying on the legacy Kotlin Gradle Plugin, which is the core objective across all modified files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request migrates the project to built-in Kotlin for AGP 9.0 compatibility by removing the legacy Kotlin Gradle Plugin and updating the JVM target configuration to use the new Kotlin compiler options. It also adjusts Gradle properties and updates dependency constraints. Feedback on these changes suggests wrapping the kotlin configuration block in plugins.withId('org.jetbrains.kotlin.android') to prevent build failures in consuming apps that have not yet migrated, and reducing the Gradle heap size allocation in gradle.properties from 8G to a more reasonable limit to avoid out-of-memory issues on CI/CD runners.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread android/build.gradle
Comment on lines +57 to +61
kotlin {
compilerOptions {
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

If a consuming app has not yet migrated to built-in Kotlin (i.e., they do not have android.builtInKotlin=true in their gradle.properties), the kotlin extension will not be registered on this project. This will cause the build to fail with a MissingMethodException when trying to evaluate the kotlin block.

To make this configuration safe and backward-compatible, wrap the kotlin block inside plugins.withId('org.jetbrains.kotlin.android'). This ensures the block is only evaluated if the Kotlin plugin is actually applied.

plugins.withId('org.jetbrains.kotlin.android') {
    kotlin {
        compilerOptions {
            jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
        }
    }
}

Comment thread example/android/gradle.properties

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@example/android/gradle.properties`:
- Line 1: The org.gradle.jvmargs setting is over-provisioned (-Xmx8G) and can
prevent the Gradle daemon from starting on typical 4–6GB machines; change the
default in the gradle.properties entry named org.gradle.jvmargs to a safer
memory cap (e.g., -Xmx2G with existing metaspace and code cache flags preserved)
and rely on local overrides for higher-memory environments so CI/dev machines
won't fail to start the daemon.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2fccb7a6-ca61-44e4-a981-5559ddd71ae4

📥 Commits

Reviewing files that changed from the base of the PR and between 9811f83 and f779d89.

📒 Files selected for processing (5)
  • CHANGELOG.md
  • android/build.gradle
  • example/android/app/build.gradle
  • example/android/gradle.properties
  • pubspec.yaml

Comment thread example/android/gradle.properties
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