The error is:
File google-services.json is missing from module root folder. The Google Quickstart Plugin cannot function without it.
The google-services. json file is generally placed in the app/ directory (at the root of the Android Studio app module).
Once your Android app has been registered, download the configuration file from the Firebase Console (the file is called google-services. json ). Add this file into the android/app directory within your Flutter project.
There is no way to use two google-services. json files in a single Android app. The file name is the same between them and they need to be in the same location. So one will overwrite the other in that case.
Above asked question has been solved as according to documentation at developer.google.com https://developers.google.com/cloud-messaging/android/client#get-config
2018 Edit : GCM Deprecated, use FCM
The file google-services.json
should be pasted in the app/ directory. After this is when I sync the project with gradle file the unexpected Top level exception error comes. This is occurring because:
Project-Level Gradle File having
dependencies { classpath 'com.android.tools.build:gradle:1.0.0' classpath 'com.google.gms:google-services:1.3.0-beta1' }
and App-Level Gradle File having:
dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:22.1.1' compile 'com.google.android.gms:play-services:7.5.0' // commenting this lineworks for me }
The top line is creating a conflict between this and classpath 'com.google.gms:google-services:1.3.0-beta1'
So I make comment it now it works Fine and no error of File google-services.json is missing from module root folder. The Google Quickstart Plugin cannot function without it.
The document says:
Copy the file into the
app/
folder of your Android Studio project, or into theapp/src/{build_type}
folder if you are using multiple build types.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With