there are now 2 legacy ways to update the gradle configuration and the latest Flutter version requires updating the settings.gradle file rather than android/build.gradle which you can read more about here. I've refactored the gradle writing to make it clearer what is being updated. Hence why there is now an enum for each different gradle configuration.
I've tested against all three types. At the moment, the CI only tests against the latest and perhaps if there is a bigger use case, I will test against legacy Flutter versions which create different gradle configurations.
Below are the results of running flutterfire configure --yes --project=project-id --platforms=android against all 3 different gradle configurations:
plugins {
id "com.android.application"
// START: FlutterFire Configuration
id 'com.google.gms.google-services'
id 'com.google.firebase.firebase-perf'
id 'com.google.firebase.crashlytics'
// END: FlutterFire Configuration
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}
Latest Flutter version >= 3.16.5
android/app/build.gradle:
plugins {
id "com.android.application"
// START: FlutterFire Configuration
id 'com.google.gms.google-services'
id 'com.google.firebase.firebase-perf'
id 'com.google.firebase.crashlytics'
// END: FlutterFire Configuration
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}
android/settings.gradle:
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.3.0" apply false
// START: FlutterFire Configuration
id "com.google.gms:google-services" version "4.3.15" apply false
id "com.google.firebase:perf-plugin" version "1.4.1" apply false
id "com.google.firebase:firebase-crashlytics-gradle" version "2.8.1" apply false
// END: FlutterFire Configuration
}
Type of Change
[ ] โจ feat -- New feature (non-breaking change which adds functionality)
[X] ๐ ๏ธ fix -- Bug fix (non-breaking change which fixes an issue)
[ ] โ ! -- Breaking change (fix or feature that would cause existing functionality to change)
Description
fixes https://github.com/invertase/flutterfire_cli/issues/251
there are now 2 legacy ways to update the gradle configuration and the latest Flutter version requires updating the
settings.gradle
file rather thanandroid/build.gradle
which you can read more about here. I've refactored the gradle writing to make it clearer what is being updated. Hence why there is now an enum for each different gradle configuration.I've tested against all three types. At the moment, the CI only tests against the latest and perhaps if there is a bigger use case, I will test against legacy Flutter versions which create different gradle configurations.
Below are the results of running
flutterfire configure --yes --project=project-id --platforms=android
against all 3 different gradle configurations:Legacy gradle configuration 1
android/app/build.gradle
:android/build.gradle
:Legacy gradle configuration 2
android/build.gradle
:android/app/build.gradle
:Latest Flutter version >= 3.16.5
android/app/build.gradle
:android/settings.gradle
:Type of Change
feat
-- New feature (non-breaking change which adds functionality)fix
-- Bug fix (non-breaking change which fixes an issue)!
-- Breaking change (fix or feature that would cause existing functionality to change)refactor
-- Code refactorci
-- Build configuration changedocs
-- Documentationchore
-- Chore