-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Open
Labels
Needs AttentionThis issue needs maintainer attention.This issue needs maintainer attention.plugin: analyticsplugin: performancetype: enhancementNew feature or requestNew feature or request
Description
Is there an existing issue for this?
- I have searched the existing issues.
Which plugins are affected?
- Analytics
- Performance
Which platforms are affected?
- Android
Description
The firebase_analytics and firebase_performance plugins apply the kotlin-android plugin in their android/build.gradle files. Starting with AGP 9.0.0, built-in Kotlin is the default and applying the kotlin-android plugin causes a build failure:
Failed to apply plugin 'kotlin-android'.
> ⛔ 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.
Projects that want to use AGP 9's built-in Kotlin (per the Flutter migration guide) are blocked because these plugins still reference kotlin-android.
The current workaround is to set android.builtInKotlin=false in gradle.properties and re-add the kotlin-android plugin to the app's build.gradle, but this is a temporary escape hatch that will be removed before AGP 10.0.
Reproducing the issue
- Create or migrate a Flutter project to AGP 9.0.0 following https://docs.flutter.dev/release/breaking-changes/migrate-to-agp-9
- Add
firebase_analyticsorfirebase_performanceas a dependency - Run
flutter build apk --debug - Build fails with the error above
Firebase Core version
3.14.0
Flutter doctor
Flutter (Channel stable, 3.38.9)
Dart version 3.10.8
Android SDK version 36.0.0
Flutter dependencies
firebase_analytics: 12.1.1
firebase_performance: ^0.11.1+4Additional context
- Flutter tracking issue: [many] Flutter maintained plugins should support AGP 9.0 flutter/flutter#181383
- Flutter migration guide: https://docs.flutter.dev/release/breaking-changes/migrate-to-agp-9
- Android built-in Kotlin docs: https://developer.android.com/build/migrate-to-built-in-kotlin
- Similar issue on plus_plugins: [Compile]: The 'org.jetbrains.kotlin.android' plugin is no longer required for Kotlin support since AGP 9.0 fluttercommunity/plus_plugins#3745
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Needs AttentionThis issue needs maintainer attention.This issue needs maintainer attention.plugin: analyticsplugin: performancetype: enhancementNew feature or requestNew feature or request