Error "File google-services.json is missing from module root folder. The Google Services Plugin cannot function without it" [duplicate]
You need to get the configuration file from the developer's site and paste it in the app level directory of your project.
Update:
Goto
https://console.firebase.google.com/
Select your project
On the left menu, click on settings > project settings
Add an app or download the google-services.json file under the Your Apps section.
Please go to this URL :
https://developers.google.com/mobile/add
Choose your Options and finally you will be able to download
google-service.json
file
copy that file and paste it Into
YourProjectName/app
Directory
Then recompile the project Most probably it will fly
In my case the project directory looks like this :
For anyone using Firebase you need to go into your console and there it should say "add project to Android". From there, it will step-by-step generate the google-services.json file for you.
I received this error while trying to run Google's Firebase analytics sample app:
Prerequisites:
- Download https://github.com/firebase/quickstart-android
- Add quickstart/analytics to Android Studio
Add Procedure:
- Go to https://firebase.google.com/
- Click on "GO TO CONSOLE"
- Click on "Add Project"
- Project name: Enter: sample-app
- Click "Create Project" [Takes about 10 seconds or so...]
- Click "Continue"
- On the "Getting Started" page, click "Add Firebase to your Android app"
- Enter package name for the android app [The full package name appears at the top of the manifest: "com.google.firebase.quickstart.analytics"]
- Click on download google-services.json
- In file explorer, add google-services.json to the directory: "quickstart/analytics/app" [Warning: Do not rename the file, it must be: google-services.json]
- Run 'app'
- The sample app already contains the necessary Gradle file settings.
- When adding a new project do: Tools -> Firebase -> Analytics -> Add Event -> Connect App to Firebase.
- Adding a project via Android Studio ensures that all the Gradle Dependecies are setup.
Remove Procedure:
- Go to https://firebase.google.com/
- Click on "GO TO CONSOLE"
- Settings -> Project Settings -> Delete this App
- Settings -> Project Settings -> Delete Project
- Enter project ID and press delete
I added and removed the sample app multiple times without any noticeable side effects.