Add Firebase to your Android App - skips `build.gradle` modifications
In Step 6 here: https://codelabs.developers.google.com/codelabs/friendlyeats-flutter/#5
The "Add Firebase to your Android App" suggests you can skip modifications to the build.gradle
"10. Back in the Firebase console, skip the remaining steps, and go back to the main page of the Firebase console."
This will cause errors such as:
FirebaseException ([core/not-initialized] Firebase has not been correctly initialized.
Usually this means you've attempted to use a Firebase service before calling `Firebase.initializeApp`.
View the documentation for more information: https://firebase.flutter.dev/docs/overview#initialization
)
Please add steps to implement the build.gradle modifications
In android/build.gradle
- Add
classpath 'com.google.gms:google-services:4.3.10'todependencies
In android/app/build.gradle
- Add
apply plugin: 'com.google.gms.google-services'
This is a great addition. The Firebase plugins for Flutter have changed a bit since the Friendlyeats Flutter codelab was written (and it hasn't been updated yet, as you've encountered!)
This is a more modern Flutter + Firebase codelab that might be less problematic to follow, until this one gets updated again!
https://firebase.google.com/codelabs/firebase-get-to-know-flutter#0