# Android Setup

To integrate your plugin into the Android part of your app, follow these steps (from the firebase messaging plugin):

1. Using the [Firebase Console](https://console.firebase.google.com/) add an Android app to your project: Follow the assistant, download the generated `google-services.json` file and place it inside `android/app`.
2. Add the classpath to the `[project]/android/build.gradle` file.

```
dependencies {
  // Example existing classpath
  classpath 'com.android.tools.build:gradle:3.5.3'
  // Add the google services classpath
  classpath 'com.google.gms:google-services:4.3.2'
}
```

3\. Add the apply plugin to the `[project]/android/app/build.gradle` file.

```
// ADD THIS AT THE BOTTOM
apply plugin: 'com.google.gms.google-services'
```

{% hint style="info" %}
If this section is not completed you will get an error like this:
{% endhint %}

```java
java.lang.IllegalStateException:
Default FirebaseApp is not initialized in this process [package name].
Make sure to call FirebaseApp.initializeApp(Context) first.
```

{% hint style="info" %}
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.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mpush.cloud/flutter-sdk/android-setup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
