Skip to content

Chore: MOBILE-140 - Apply kotlin-android on AGP 9 when builtInKotlin is off - #15

Merged
mabidakun merged 2 commits into
mainfrom
chore/agp9-builtin-kotlin-off
Nov 12, 2026
Merged

mabidakun merged 2 commits into
mainfrom
chore/agp9-builtin-kotlin-off

Conversation

@mabidakun

@mabidakun mabidakun commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

MOBILE-140

What does this PR do? 🧐

Fixes the Android build of this plugin for apps on AGP 9 that set android.builtInKotlin=false, and releases it as 0.8.2.

  • android/build.gradle - the plugin now applies kotlin-android when the app's AGP major version is below 9 or when the app sets android.builtInKotlin=false. Before, 0.8.1 applied it only below AGP 9.
  • pubspec.yaml - version: 0.8.1 -> 0.8.2.
  • CHANGELOG.md - new ## 0.8.2 section. The ## Unreleased docs line from Chore: MOBILE-4162 - Repoint homepage and podspec author at the Spring Health fork #14 now ships in 0.8.2.
  • .github/workflows/build.yml - both build jobs now check out into a folder named iterable_flutter. The repository is named iterable-flutter, so the default checkout folder was iterable-flutter, and the Build iOS check failed: SPM rejects the example app's path dependency when the folder name does not match the package name (identity 'iterable-flutter' doesn't match override's identity (directory name) 'iterable_flutter'). The Android change does not cause this failure. Main has had no CI run since 2026-07-22.

Why: Apps on Flutter 3.50 often keep android.builtInKotlin=false (Flutter's migrator adds it), because many plugins still apply the Kotlin Gradle Plugin themselves. Cherubi must keep it: with true, app_badge_plus and other plugins fail. With that opt-out on AGP 9, 0.8.1 applied no Kotlin plugin at all. Nothing compiled the plugin's Kotlin sources, and the app build failed with cannot find symbol IterableFlutterPlugin.

AGP 8, and AGP 9 with built-in Kotlin on, are unchanged.

Test Evidence

Check Result
flutter analyze (Flutter 3.47.9) ✅ No issues found
flutter test ✅ 13/13
flutter pub publish --dry-run ✅ 0 warnings (1 hint: pub.dev's previous upstream version is 0.5.8, not relevant because publish_to: none)
Cherubi Android debug build, Flutter 3.50.0 / Gradle 9.5.0 / AGP 9.3.1 / Kotlin 2.4.20 / builtInKotlin=false, this change through a local override ✅ builds; app signs in and all 5 tabs render on a Pixel 8 API 35 emulator
Cherubi Android release build, same setup ✅ builds; no crash after a cold relaunch

How should this be manually tested? 🤓

  1. In an app on AGP 9 with android.builtInKotlin=false in android/gradle.properties, point iterable_flutter at this branch.
  2. flutter build apk --debug - expect success. On 0.8.1 the same build fails with cannot find symbol IterableFlutterPlugin.
  3. Remove android.builtInKotlin=false and build again - expect success (built-in Kotlin path, unchanged).

Edge Cases

  • The property check trims the value and ignores case, so False or false also count as off.
  • An app on AGP 8 does not need the property; the AGP version check alone applies the plugin, as before.

Any background context you want to provide? 🤗

Found during the Cherubi Flutter 3.50.0 upgrade (SpringCare/cherubi#8428). Cherubi will pin ref: 0.8.2 after this merges and the tag exists.

See https://docs.flutter.dev/release/breaking-changes/migrate-to-built-in-kotlin

@mabidakun
mabidakun merged commit 96c25bd into main Nov 12, 2026
4 checks passed
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