1.) What does google-services.json really do?
Follow this : https://stackoverflow.com/a/31598587/2382964
2.) How does google-services.json file affects your android studio project?
Follow this : https://stackoverflow.com/a/33083898/2382964
just in short for second url, if you add google-services.json in your project there must be a auto-generated google-services
folder for debug
variant in this path
app/build/generated/res/google-services/debug/values/values.xml
3.) What to do, to make it done?
add google-services dependency in project_level
build.gradle, you can also use version 3.0.0
if you are using app_compact library.
// Top-level build.gradle file
classpath 'com.google.gms:google-services:2.1.2'
now in app_level
build.gradle you have to add at the bottom.
// app-level build.gradle file
apply plugin: 'com.google.gms.google-services'
4.) Where to put google-service.json file in your structure.
case 1.) if you have no build_flavor just put it in inside /app/google-service.json
folder.
case 2.) if you have multiple build_flavor and you have different-different google_services.json files put inside app/src/build_flavor/google-service.json
.
case 3.) if you have multiple build_flavor and you have single google_services.json file put inside app/google-service.json
.