Android Setup
To integrate your plugin into the Android part of your app, follow these steps (from the firebase messaging plugin):
  1. 1.
    Using the Firebase Console add an Android app to your project: Follow the assistant, download the generated google-services.json file and place it inside android/app.
  2. 2.
    Add the classpath to the [project]/android/build.gradle file.
1
dependencies {
2
// Example existing classpath
3
classpath 'com.android.tools.build:gradle:3.5.3'
4
// Add the google services classpath
5
classpath 'com.google.gms:google-services:4.3.2'
6
}
Copied!
3. Add the apply plugin to the [project]/android/app/build.gradle file.
1
// ADD THIS AT THE BOTTOM
2
apply plugin: 'com.google.gms.google-services'
Copied!
If this section is not completed you will get an error like this:
1
java.lang.IllegalStateException:
2
Default FirebaseApp is not initialized in this process [package name].
3
Make sure to call FirebaseApp.initializeApp(Context) first.
Copied!
When you are debugging on Android, use a device or AVD with Google Play services. Otherwise you will not be able to authenticate.When you are debugging on Android, use a device or AVD with Google Play services. Otherwise you will not be able to authenticate.
Copy link