Make sure the config file name is not appended with additional characters, like 2. To enable Firebase products in your app, add the google-services plugin to your Gradle files.
In your root-level project-level Gradle file build. Check that you have Google's Maven repository, as well. Using the Firebase Android BoM , declare the dependencies for the Firebase products that you want to use in your app.
Getting a build failure about invoke-custom support and enabling desugaring? Here's how to fix it. Learn more about this build failure in this FAQ. That's it! You can skip ahead to check out the recommended next steps. The Firebase Assistant registers your app with a Firebase project and adds the necessary Firebase files, plugins, and dependencies to your Android project — all from within Android Studio! Open your Android project in Android Studio, then make sure that you're using the latest versions of Android Studio and the Firebase Assistant:.
In the Assistant pane, choose a Firebase product to add to your app. This workflow automatically creates a new Firebase Android app using your app's package name. You can create this new Firebase Android app in either an existing Firebase project or a new project. Visit Understand Firebase Projects to learn more about best practices and considerations for adding apps to a Firebase project, including how to handle multiple build variants.
If you create a new project, we strongly recommend that you set up Google Analytics for your project, which enables you to have an optimal experience using many Firebase products. This workflow also adds your Firebase project's Android configuration file google-services. Click the button to add a desired Firebase product for example, Add Analytics to your app.
In the Assistant pane, follow the remaining setup instructions for your selected Firebase product. Make sure to check out the recommended next steps.
This section lists the Firebase products supported for Android and their Gradle dependencies. Learn more about these Firebase Android libraries:. Note that when using the Firebase Android BoM , you don't specify individual library versions when you declare Firebase library dependencies in build. To learn which library versions are mapped to a specific BoM version, review the release notes for that BoM version. Store data, like user information, with Cloud Firestore or Realtime Database. Store files, like photos and videos, with Cloud Storage.
Trigger backend code that runs in a secure environment with Cloud Functions. Visit Understand Firebase Projects to learn more about Firebase projects and best practices for projects. Above asked question has been solved as according to documentation at developer.
The file google-services. After this is when I sync the project with gradle file the unexpected Top level exception error comes. This is occurring because:. The top line is creating a conflict between this and classpath 'com. The document says :. Its just simple! Click right above the app i. Select the Project from drop down and paste the json file by right click over the app package and then sync it I personally had this issue when I used.
So, when I wanted to debug, the name of the application was "all of a sudden" app. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. How to add google-services. Ask Question. Asked 6 years, 3 months ago. Active 1 year, 7 months ago. Viewed k times. Add dependencies for basic libraries required for the services you have enabled. You can see the result of this step by running.
The google-services. As of version 2. All of the following directory structures are valid:. Note: Providing a google-services. When processing the JSON file for your Android app, the plugin only uses the client object that matches your package name for the current build type based on the following logic:.
Below is an example of each file:. Every value in the XML files is present in the google-services.
0コメント