Generate google-services.json for Android - android

This might be a stupid question but I am facing an issue when trying to generate my google-services.json file for my app. I am following this guide from the google developers team to setup my project for analytics but when I click on the get configuration file button nothing happens, I just get a loading spinner that never ends.
I tried on different browsers, it's still the same. I checked the chrome console and got :
Refused to display 'https://accounts.google.com/ServiceLogin?service=cloudconsole&osid=1&passiv…3Dtrue%26cntlbl%3DContinue%2BAdding%2BAnalytics%26cntapi%3Danalytics&hl=en' in a frame because it set 'X-Frame-Options' to 'DENY'.
Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://console.developers.google.com') does not match the recipient window's origin ('null').
Any suggestion?

You are trying this link while configuration https://developers.google.com/analytics/devguides/collection/android/v4/start
So please do the following steps
Click on the GET A CONFIGURATION FILE
Now Choose your App Name.
Click Configuration Services
After that the 3rd Window will be open
Now Choose your Analytics account of your Apps.
Hurry you have done.
Please use all the process and done as it is you can do it.
Let me know if still you have any problem.

Well well, got a workaround. You console log helped: I clicked on the URL in the log ("https://accounts.google.com/ServiceLogin?service=cloudconsole&osid=1&passiv…3Dtrue%26cntlbl%3DContinue%2BAdding%2BAnalytics%26cntapi%3Danalytics&hl=en") and it led me to the right page and I have been able to generate a google-services.json for my app.

A guy from Google analytics team suggests the solution here.

Try going through this website to get your configuration file - its the one for Cloud Messaging but it has a button that says "GET CONFIGURATION FILE":
https://developers.google.com/cloud-messaging/android/client
Also I did experience the same problem last week sometime when configurating cloud messaging myself but it seemed to have resolved itself in the afternoon so it could just be a one day error thing.

Steps for getting configuration if your first time login to google developer account.
open google developer console.
login to developer console.
create project with valid name.
then goto the API section & enable GCM API.
Then get the configuration file.

Related

OAuth consent screen blank in android app with Google Fit

I'm trying to use the Google Fit API in my application, after the user is prompted to choose a Google account the OAuth consent screen should be displayed, however I only get a blank popup with a indefinite loading indicator, this popup will stay like that unless I cancel it.
Image of the popup
No error messages are displayed, only if I cancel the sign-in flow I would get an error that I cancelled it.
I have tried on a personal proyect as well as with Google's sample proyect, where other users are also experiencing the same issue.
As I describe on that issue, I have tested both apps on an emulator, a Huawei Pro 20 Lite, and on another device, with four different accounts, but get the same result.
Also have the correct configuration in the Google Cloud Console, using the proper applicationId and SHA1 signing key, I've tried on two different cloud projects, one of them brand new.
The function that launches the sign-in flow is this one, the full code from the sample app can be found here
GoogleSignIn.requestPermissions(
this,
requestCode.ordinal,
getGoogleAccount(), fitnessOptions)
Thanks for any help.
I found a solution, it strange but anyway it works for me:
Delete your Cloud project
Instead of the following instructions from http://developers.google.com/fit/android/get-started create a new project with firebase.
Add an android app in firebase project settings
Add both the SHA1 and SHA256 to it.
Download google-services.json to android/app in your project folder.
Make sure to have my "support email" set on general Project settings.
If this not help, please also check Flutter and google_sign_in plugin: PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null)
Guys have a similar problem with GoogleSignIn
Follow the instructions at http://developers.google.com/fit/android/get-started for registering an Android client.
Ensure that the Fit API is enabled for your Cloud project.
Check your credentials for your Cloud project:
Ensure that your package name for your credentials matches the sample.
Ensure the package name matches the applicationId in the app/build.gradle file.
Ensure the Signing-certificate fingerprint is entered correctly.
Additionally from OAuthConsentScreen add test users and set User Type to external

The issue in Google Sign-In for Android

brother, I'm now integrating Google login functionality into my app in accordance with Google Docs.
When I follow the instructions in the document, I click on the button Configure a project to Configure a Google API Console project and I filled out all the information that I needed to fill out, including the platform, package name, and the value of sha-1, but when I clicked on the create button in popWindow again, I got the message Something went wrong. Please try again. I have tried numerous times. All of these are the results. Can someone help me to see what causes me? Thanks a lot!!
Please check if you have already added your project in firebase. If you have, do not add the project again in google developer console; it's kind of added to developer console by default. This is how I solved the issue in my case.
Sometime, I fake this problem too
My case is:
1) I create project new from Google console first
2) I start Configure a project for Google Sign for the project created in step 1
3) Enter correct SHA1 and package_name
4) Error "Something when wrong and please try again"
I tested 5 times for 5 new projects and this problem always happened
THEN I SOLVED it by a trick like
1) I don't create new project in Google console
2) When Configure a project for Google Sign, I create new project here (don't use project name which already used before even you have shutdown it)
3) Enter correct SHA1 and package_name
4) It will working with no error
Tested it 3 times for 2 different emails and it working.
Hope it help
None of the following solutions worked for me. What I did was look into my Google API Console > Credentials. Then I noticed that while from the documentation I picked my "Type" to be "android", on the console it appeared as "Web".
When I deleted the credential and re-entered the details it worked like a charm. So if none of the solutions work, try deleting all credentials in the API console and try another time.

Ionic & Firebase Google Login with Googleplus plugin error: 10

So I'm trying to figure out the Google login system using Ionic, Googleplus plugin & Firebase. I set everything up according to the following tutorial:
https://github.com/EddyVerbruggen/cordova-plugin-googleplus
Then I ran the code on my phone as Ionic-run Android. When I do that I get an error 10. I looked it up and according to the following link:
https://github.com/EddyVerbruggen/cordova-plugin-googleplus/issues/243
It seems like it's an issue with the debug version and the key? In Firebase, I set up an Android project with the debug key but I didn't add the Google.services.json or add the code they told me to add in my build.gradle file because I get an error. I also activated the google sign in method. Then I copied the demo app index. I'm not sure If I missed a step or didn't set something up correctly.
In case it's helpful for anyone else, I spent a lot of time troubleshooting this issue on Android. You need to make sure that your client_id for a credential of type "Web application" is used even though the SHA1 certificate hash you generate is associated with an OAuth2 credential of type Android. I was using the Android client_id instead of the Web application one. More info here: https://github.com/EddyVerbruggen/cordova-plugin-googleplus/issues/425
I fixed it by using a different project, not really sure what changed.

Exception when trying to use Google Calendar API in android

I am getting exception as below:
Well, I've used or say copied same code as this shown in google doc https://developers.google.com/google-apps/calendar/quickstart/android .And I know it is the same error which is already mentioned in troubleshooting part of this doc but as mentioned in its solution, I had checked my SHA1 fingerprint and also package name and all the stuffs but still getting same error. And also I tried to google and followed each and every link the google suggested but nothing works for me so my last option was STACKOVERFLOW and so I am here. Please help if any one can. Thanks in advance.
Also I forgot to mention, it says "Unregistered Android application" it means that the OAuth2 client ID I created is not found by the app but I don't know how can I make it find my OAuth2 client ID and solve my problem.
Please make sure that:-
You enabled calendar API in google console for that project you are using, as the link provide in your response.
Also match your package name in AndroidManifest is similar to the package you mentioned in google dev console with SHA.
Try to create an Oauth client id under corresponding project in google console. Follow the steps in this link.
To create an OAuth 2.0 client ID in the console:
Go to the Cloud Platform Console.
From the projects list, select a project or create a new one.
If the API Manager page isn't already open, open the console menu and select API Manager.
On the left, click Credentials.
Click New Credentials, then select OAuth client ID.
Note: If you're unsure whether OAuth 2.0 is appropriate for your project, select Help me choose and follow the instructions to pick
the right credentials.
Select the appropriate application type for your project and enter any additional information required. Application types are described
in more detail in the following sections.
If this is your first time creating a client ID, you can also configure your consent screen by clicking Consent Screen. (The
following
procedure
explains how to set up the Consent screen.) You won't be prompted to
configure the consent screen after you do it the first time.
Click Create client ID.
Based also from this related post, you have to give permission from your calendar configuration (Calendar configuration -> Share this calendar) to the email account specified into Google Api Console (email adress).
Hope this helps!

How to get google-service.json file and google app id for integrating Airpush ads on android

I want to integrate Airpush ads on my android app. But the problem occurs on the second step of their official documentation. I have never used google play service in any of my app.So I don't know how to do this. I see my logcat and it was saying
Missing an expected resource: 'R.string.google_app_id' for initializing Google services. Possible causes are missing google-services.json or com.google.gms.google-services gradle plugin
I followed this instruction and this instruction also. But I am not understanding this. Because in the first instruction, after creating app Google is saying me to choose service. But here is my problem that I don't know which service is required for integrating Airpush.
So, I need help. I don't know how to get my google app id and get the json file. Please give me step by step instructions for this.
Thanks..
The first, go to :
https://console.cloud.google.com/home
then select your google project. Go to Dashboard than you can see your project id and project number
The second, you can go to this page to get your google-services.json file:
https://developers.google.com/mobile/add?platform=android&cntapi=gcm&cnturl=https:%2F%2Fdevelopers.google.com%2Fcloud-messaging%2Fandroid%2Fclient&cntlbl=Continue%20Adding%20GCM%20Support&%3Fconfigured%3Dtrue

Categories

Resources