Skip to content

[package_info_plus] Migrate to Built-in Kotlin (AGP 9 support) #3881

@manuel-goester-n41

Description

@manuel-goester-n41

Summary

Starting with Android Gradle Plugin (AGP) 9.0, support for applying the Kotlin Gradle Plugin (KGP) is removed. package_info_plus applies KGP directly in its Android build, so under AGP 9.0+ it causes a configuration error that prevents the host app from building. On AGP 8.x it currently only produces a warning, but Flutter 3.44 has only temporarily shimmed this support, and that shim is slated to be removed in a future Flutter release.

Where

In packages/package_info_plus/package_info_plus/android/build.gradle (latest published 10.1.0, and identical on main):

  • apply plugin: 'kotlin-android'
  • buildscript classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" (Kotlin 2.2.0)

There is no Kotlin-DSL build.gradle.kts for this package, so no current version is AGP-9-ready.

Ask

Please migrate to Built-in Kotlin following Flutter's plugin-author guide:
https://docs.flutter.dev/release/breaking-changes/migrate-to-built-in-kotlin/for-plugin-authors

Concretely: stop applying kotlin-android and move the Kotlin compiler configuration into a top-level kotlin { compilerOptions { … } } block. The first-party flutter/packages plugins are a good reference for the target shape — e.g. shared_preferences_android 2.4.24 and webview_flutter_android 4.12.1 ("Migrates to Built-in Kotlin to support AGP 9").

Impact

This currently blocks downstream apps from upgrading to AGP 9 / Gradle 9, since a single KGP-applying plugin fails the whole build under AGP 9. Thanks for maintaining the plus_plugins suite! 🙏

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions