Is there another place to get a google-services.json?
OK, I've found a workaround if anyone else is having this problem.
Based on the error message about being unable to display https://accounts.google.com/ServiceLogin?service=cloudconsole&osid=1&passiv…ed%253Dtrue%26cntlbl%3DContinue%2BAdding%2BSign-In%26cntapi%3Dsignin&hl=en in a frame... I just followed that link directly.
EDIT: None of the other links were working for me. If you came searching for the console errors Refused to display...
, this is the answer for you. This bug seems to have been fixed for the google-services.json, so if you're just looking for the link, the highest-rated answer is the one you want.
google-services.json Google Cloud oauth login and Firebase dynamic link same project android
If you are using the same project then feel free to use the last one google-services.json
that it suggests downloading because it will already include your previous configuration.
You can easily check this if you compare the first and second one jsons.
Make sure that you only have this most recent downloaded config file in your app.
You can get the most recent config file for your Android app in Firebase Console at any moment.
- Go to your Project settings in the Firebase console.
- In the Your apps card, select the package name of the app for which you need a config file.
- Click
google-services.json
.
google-services.json location in the project tree
I figured I copied it into the right folder. Here's the tutorial I found which helped me:
How to add google-services.json in Android?
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.
google-services.json for different productFlavors
Google included support for flavors in version 2.0 of the play services plugin. Since this version of the gradle plugin com.google.gms:google-services:2.0.0-alpha3
you can do this
Step 1: add to gradle
// To auto-generate google map api key of google-services.json
implementation 'com.google.android.gms:play-services-maps:17.0.0'
Step 2: add to AndroidManifest.xml in the application tag
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/google_api_key" />
Step 3: download each flavor JSON file from firebase and add it
app/src/
flavor1/google-services.json
flavor2/google-services.json
Version 3.0.0 of the plugin searches for the JSON file in these locations (considering you have a flavor
flavor1 and a build type debug
):
/app/src/debug/google-services.json
/app/src/debug/flavor1/google-services.json
/app/google-services.json
This worked for me even using flavorDimensions. I have free & paid in one dimension and Mock & Prod in the other dimension. I also have 3 buildTypes: debug, release, and staging. This is how it looks in my project for the FreeProd flavor:
How many google-services.json files will depend on your project's characteristics, but you will need at least one JSON file for every Google project.
If you want more details about what this plugin does with these JSON files, here it is:
https://github.com/googlesamples/google-services/issues/54#issuecomment-165824720
Link to the official docs:
https://developers.google.com/android/guides/google-services-plugin
Blog post with updated info: https://firebase.googleblog.com/2016/08/organizing-your-firebase-enabled-android-app-builds.html
And go here to check the latest version of this plugin: https://mvnrepository.com/artifact/com.google.gms/google-services?repo=google
File google-services.json is missing. where to find this file ? PHONEGAP
You can get the google-services.json from firebase developer console.
Click your application, here the application name is testapp
Next you will find this screen click on the menu you will see settings click on it.
In setting you will be able to see the "Download Google-services.json" button.
There you will find the google-services.json file for your existing project.
Hope this helps.
Where do I place Googleservices.json in Flutter app in order to solve 'google-services.json is missing'
You need to place it under android/app
:
Also it should be named google-services.json
without the space after the dash. To rename it right click on it then click Refactor>Rename.
How do I get the google-services.json file again, was accidentally deleted
Finally found answer
To download a config file for an Android app:
- Sign in to Firebase and open your project.
- Click cog icon and select Project settings.
- In the Your apps card, select the package name of the app you need a config file for from the list.
- Click downloadarrow google-services.json.
https://support.google.com/firebase/answer/7015592
Related Topics
Make Android Webview Not Store Cookies or Passwords
Should The Call to The Superclass Method Be The First Statement
Android: Share Session Between Webview and Httpclient
Android - Set a Progressbar to Be a Vertical Bar Instead of Horizontal
Notification Passes Old Intent Extras
Bitmapdrawable Deprecated Alternative
How to Enable Internal App Sharing for Android
Successful Share Intent for Android
Should I Use Getapplicationcontext or Activity.This in a Long Running Asynctask
How to Set The Rounded Corner Radius of a Color Drawable Using Xml
Error: Error Parsing Xml: Not Well-Formed (Invalid Token) ...
Gradle: Add Dependency for a Specific Flavour of The Library
What Is The Different Between Explicit and Implicit Activity Call in Android
When Should I Do Certain Sqlite Operations on Another Thread(Not The Main Thread)
Difference Between App-Debug.Apk and App-Debug-Unaligned.Apk