Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion example/android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pluginManagement {

plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "8.11.1" apply false
id "com.android.application" version "9.5.0" apply false

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔴 After this merges, the example Android app no longer builds, so the build-android CI job fails. AGP 9.x needs Gradle 9.1.0 or newer. The wrapper still pins gradle-8.14.3 in example/android/gradle/wrapper/gradle-wrapper.properties, and AGP stops configuration with a "Minimum supported Gradle version" error. Fix: in this same change, update distributionUrl to a Gradle 9.x release that AGP 9.5.0 supports. If you are not doing the AGP 9 migration now, keep AGP at 8.x and ignore this major version.

Why this was flagged

Any flutter build apk or Gradle sync of example/android runs .github/workflows/build-android.yml, and so do pull-request.yml and release-publish.yml. Both resolve com.android.application 9.5.0 from settings.gradle:22. Each AGP release checks the running Gradle version at plugin apply time. AGP 9.0 already requires at least Gradle 9.1.0, and the wrapper still points at gradle-8.14.3-all.zip, so configuration aborts before any task runs. On the base, AGP 8.11.1 supports Gradle 8.14.3 and the example builds. Nothing in the diff updates the wrapper, and Dependabot's gradle ecosystem only edits the plugin version string.

Verification: The diff changes settings.gradle:22 to id "com.android.application" version "9.5.0" apply false. The wrapper was not touched: example/android/gradle/wrapper/gradle-wrapper.properties still uses gradle-8.14.3-all.zip. AGP 9.0 already needs at least Gradle 9.1.0. On the base, AGP 8.11.1 with Gradle 8.14.3 is a supported pair, so this is a regression.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔴 With AGP 9, the example app's Kotlin setup fails to build even after the Gradle wrapper is upgraded. AGP 9 enables built-in Kotlin by default and rejects the separate org.jetbrains.kotlin.android plugin, which settings.gradle:23 and app/build.gradle still apply. The android { kotlinOptions { ... } } block in app/build.gradle is also no longer supported. Fix: migrate to built-in Kotlin by removing the kotlin.android plugin and moving jvmTarget to kotlin { compilerOptions { ... } }. Or set android.builtInKotlin=false in gradle.properties. Either way, the Flutter-applied plugin modules must keep compiling.

Why this was flagged

settings.gradle:22 bumps com.android.application to 9.5.0 while settings.gradle:23 keeps org.jetbrains.kotlin.android 2.2.20. app/build.gradle still applies that plugin and uses kotlinOptions { jvmTarget = JavaVersion.VERSION_17 } inside android {}. In AGP 9, built-in Kotlin support is on by default. Applying the separate Kotlin Android plugin then fails with an error telling you to remove it or opt out with android.builtInKotlin=false. The kotlinOptions extension on android is also removed. example/android/gradle.properties sets neither android.builtInKotlin nor android.newDsl, so nothing opts out. On the base, AGP 8.11.1 with the separate Kotlin plugin builds fine. This needs a different fix from the Gradle wrapper issue (a build-script DSL migration, not a wrapper bump), so the build still fails after the wrapper is upgraded.

Verification: The diff changes settings.gradle:22 to id "com.android.application" version "9.5.0" apply false but leaves line 23 as id "org.jetbrains.kotlin.android" version "2.2.20" apply false. example/android/gradle.properties has no android.builtInKotlin=false opt-out. From AGP 9.0 onward, built-in Kotlin is on by default. On the base (AGP 8.11.1) the same files build.

id "org.jetbrains.kotlin.android" version "2.2.20" apply false
}

Expand Down
Loading