[android] google-services.json for different productFlavors

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.

Examples related to android

Under what circumstances can I call findViewById with an Options Menu / Action Bar item? How to implement a simple scenario the OO way My eclipse won't open, i download the bundle pack it keeps saying error log getting " (1) no such column: _id10 " error java doesn't run if structure inside of onclick listener Cannot retrieve string(s) from preferences (settings) strange error in my Animation Drawable how to put image in a bundle and pass it to another activity FragmentActivity to Fragment A failure occurred while executing com.android.build.gradle.internal.tasks

Examples related to google-cloud-messaging

Google Play Services GCM 9.2.0 asks to "update" back to 9.0.0 Firebase cloud messaging notification not received by device Error:Conflict with dependency 'com.google.code.findbugs:jsr305' Where can I find the API KEY for Firebase Cloud Messaging? How to send push notification to web browser? google-services.json for different productFlavors INSTALL_FAILED_DUPLICATE_PERMISSION... C2D_MESSAGE Android: Test Push Notification online (Google Cloud Messaging) How to get RegistrationID using GCM in android Why do I get "MismatchSenderId" from GCM server side?

Examples related to google-play-services

com.google.android.gms:play-services-measurement-base is being requested by various other libraries Error: fix the version conflict (google-services plugin) Google Play Services GCM 9.2.0 asks to "update" back to 9.0.0 updating Google play services in Emulator How to unpublish an app in Google Play Developer Console Android Studio Gradle: Error:Execution failed for task ':app:processDebugGoogleServices'. > No matching client found for package Error "File google-services.json is missing from module root folder. The Google Services Plugin cannot function without it" com.android.build.transform.api.TransformException How to add google-services.json in Android? google-services.json for different productFlavors