I ran into such a problem, when I tried to initialize firebase and get the FCM token, I get this error, who faced it? What could be the reason? A month ago, everything worked, after that nothing was changed in google-services.json file, firebase flow in project, or in google console.
API key permissions added
In our case, this happened when we added a new Firebase library to our project (Performance Monitoring). Our API key is restricted to only allow certain APIs to work, as suggested by Google.
Log in to the Google Cloud Console, and make sure you're allowing the API to work with your restricted key. In this specific case, you need to allow the Firebase Installations API.
Once I added that and waited about 10 minutes, this error stopped and the Firebase tools are working as expected with our app.
I fixed same error while adding push notifications into iOS project:
Fixed on Google Cloud console -> APIs & Services -> Credentials
then CLICK on the API Key you are using for the app having problems
Scroll to the API restrictions section
expand the combo box and select Firebase Cloud Messaging API and Firebase Installations API hit OK after selecting both and SAVE this.
REMEMBER: Wait 5 to 10 minutes to test this working, so be patient and grab a coffee before testing again :)
The problem was on key, idk why, but when I set new key, all ok.
20.05.2022 Better to use Android apps restrictions now.
Related
I have an Android app which uses Firebase Auth, and while fixing some issues I had, I noticed that there is no need to add the file google-services.json to the project.
My issue was the following. I perform a sign-in via Google Sign-In, and in the GSO (Google Sign-In Options) I specify
gsob.requestIdToken(".....apps.googleusercontent.com");
gsob.requestEmail();
because I want an idToken which I then can pass to the Firebase SDK in order to sign the user into Firebase (I'm using it this way for historical reasons).
It had stopped working which was the reason why I was meddling around with the google-services.json file, since I had deleted a Client-ID in console.developers.google.com and thought I made a mistake.
While being at removing stuff, I also removed an entry
<meta-data android:name="identitytoolkit.server_client_id" android:value="....apps.googleusercontent.com" />
and some more identitytoolkit metadata entries from the Manifest.
In the end the only thing that would matter was that the correct client-id is passed to gsob.requestIdToken(".....apps.googleusercontent.com");
I'm not sure if Google had some hiccups with the idTokens between Google Sing-In and Firebase during these last two days, but in the end I think I really didn't change anything to make it work again.
So the last couple of minutes I was reading through the Firebase documentation, and read that there are now two options for adding Firebase to an Android app, one is the one I used before, and then there's a new option to use the Firebase Assistant.
I never used the Firebase Assistant, but am wondering if it has been enabled automatically in my app (I never clicked "Click Connect to Firebase to register your app with an existing or new Firebase project and to automatically add the necessary files and code to your Android project.")
How can I find out if something in Android Studio has been altered to add my Firebase configuration automatically? Where do I know which client-id's it's using?
I'm asking because even the email-based authentication with Firebase (which is not using Google Sign-In explicitly) is working in the app, and there are is no json file or other client-id's in the Manifest or in the code which could be used for this.
Nothing has changed in the setup instructions. You either need to have the Play services plugin and google-server.json present, or you need to duplicate its work manually. The only ways to manually duplicate its work are to add the specific string resources to your app that it requires, or call initalizeApp with your specific settings. There are currently no alternatives.
I am trying to create a simple Google authentication example, but the login success callback is not triggered. Here is what I have done:
Added build hint android.playService.auth, android.playService.auth both set to true.
Created a developer certificate for android, and pasted SHA1 into Google Developer console Android client
In the Google developer console, enable Google Plus API.
Then I pasted the example code from here https://www.codenameone.com/google-login.html
But on the device, the successful login callback is not triggered after the first doLogin() call, only after the second.
Note that following similar steps I was able to configure Facebook auth and everything went fine. I am not sure what I am doing wrong here though.
How do I configure Google Authentication in Codename One?
This seems to be a regression with the migration to API level 23 and the new Android permissions system the current workaround is to revert to API level 21 but that poses a problem with apps already submitted to Google with level 23.
I've filed this issue to track the fix that should work for newer API levels.
I have an Android app with push notifications send by GCM. I set this up a few years ago. All works fine.
Now i want to manage my API keys but the Google Play Developer Console is not showing the API keys anymore, like they use to do. They always link to the new Firebase API.
I tried https://console.cloud.google.com/apis/credentials but the new API keys won't be accepted by Google and the old one doesn't show up there. That's maybe because I can't link it to my Android app.
Where can I still manage my GCM API keys? I want to create a new one but I don't want to migrate my project to Firebase. Is this still possible?
Go to Android Start and click Get a Configuration File. There you'll be able to generate GCM API keys. The same goes if you're using iOS.
If you are like me and gave in to FCM, you can still use the GCM project identity: its under console, FCM settings and contains the server key and identity.
Visit this link and follow the steps
https://developers.google.com/mobile/add?platform=android
Download the google-service.json file, it contains the keys you need
I am developing an Android App using Firebase. I had everything running fine up to this morning. I went to Firebase, imported the project at their new console and then I tried to add Analytics to my app.
At this point I couldn't use Google login, and I guess it was because adding Analytics I skipped to add my SHA-1 key, so the newest information at Google was that I didn't have a SHA-1 key. I didn't see that I had to whitelist my Google app which was actually login in people in my app, and that was a big mistake. Trying to solve it I begun to change things, so many that I couldn't even list them here. A short version could be:
I updated the Android SKD Manager.
I changed the dependencies for Gradle. Still not working.
I saw that I could give my SHA-1 key to Firebase, but I had a alert saying that this key was already in use by another App (the one at Google API)
In order to solve it, I deleted the credentials of my Google API App -not so good idea-
Then I used my SHA-1 key at Firebase. Still not working.
I tried to put everything as it was at the beginning, but now I cannot delete my key from Firebase. What I've done is write a random key to be able to use it at Google API.
I went to Google API and created a new credential for the App that I was using and was working fine up to this morning.
I whitelisted the App ID at my Firebase Auth settings. Still not working
Surely I have done other stuff but I don't even remember.
Now I have the following error when I try to login with Google, but also with Facebook(?!), and I haven't tried with other providers. The error says:
FirebaseLoginError = PROVIDER_NOT_ENABLED: Make sure google login is enabled and configured in your Firebase. (FirebaseError: Invalid authentication credentials provided.)
There are so many things that could lead to a problem that I have been trying to fix it during all the morning and I am still completely lost.
What should I do to restore everything as it was?
I'm trying to implement Google Play Services following Google's documentation and I'm seeing the following when I try to connect my GameClient:
E/Volley: [4953] il.a: Unexpected response code 401 for https://www.googleapis.com/games/v1/players/me
E/Volley: [4953] il.a: Unexpected response code 401 for https://www.googleapis.com/games/v1/players/me
E/SignInIntentService: There is no linked app associated with this client ID.
I've checked that the SHA1 fingerprint of the certificate signing the APK, the SHA1 of the debug certificate, and the SHA1 given to the Google API do match up and they do. I've checked that the app id is declared in the manifest in the application item (I've taken in my case the 13 digit numerical id, not one that also includes a package). I've also checked that the test accounts I'm using are each listed in the Developer Console and they are; they're each #gmail.com too, and they include my developer address. They've each activated Google Plus.
I've tried this from an API 16 S3 device and an API 17 Google API simulator. The app's package name is correctly declared in the manifest, on the developer console and matches the API package name. The app is listed as a client of the game service, and is shown as 'ready for testing'.
In short I'm struggling to see what my mistake can be and what I've missed. I think I have everything from Google's troubleshooting addressed too. I've looked at the main questions here on StackOverflow, and they're covered. Whatever it is I'm missing is probably staring me full in the face. What can I be missing?
I got stuck on this problem for a long time until I realised that I had two strings in my app called "app_id". One from the Facebook SDK and one from Google. I renamed the Google app_id (and changed the corresponding manifest reference) and all was well.
It is POSSIBLE that you have a similar problem. If you can't see the error then I would try to write out the app_id to syslog to confirm that this is not the cause of the problem.
Incidentally, all my Google app_id s (client ids) are 12 bytes not 13, so perhaps you should start by checking that.
Good Luck !
Even after redoing everything, everything, I still encountered the same problem. However, I subsequently encountered a "This package is already in use" error message on Google API even though I had undeleted all projects and removed all clients before deleting these again.
This turned out to be a blessing: The solution to this was to recreate my debug key before adding the new fingerprint to Google API in another new client id.
And lo... my original problem went away.
I hade the same problem and for me it worked to re-link the app in Game services -> Linked apps -> Link another app.
You didn't explicitly state that the gmail accounts you're testing with are added as Google Plus users in a Google Plus community that is configured as the testing community for your app -OR- that you're using a google group as the testing community and those gmail accounts are part of that community.
If you have done those things, then it might be the issue stated here:
https://code.google.com/p/google-plus-platform/issues/detail?id=554
This answer might sound encouraging to solve your problem, but don't get your hopes up. I've done all that the original poster did, plus the things above, and I'm still stuck.
I've even followed all of the tips stated here:
Google Play Game Services - unable to sign in
And it would appear the depths of the chasm that Google lets you fall into regarding GPS is far deeper than the depths I've plumbed. Joy.
I had the same problem ,I am not sure that the following action is the one that resolved the problem but its worth the try,
Seems that I didnt had the Drive API enabled ,I had it in the enabled apis but i had to actually click the gear icon next to it and then click enable and provide the application name.
Just link the same package as many times as you have Client ID's in your Developer Console "Debug & Release Client ID's"
The thing is if you link your app to the Game Services with the wrong SHA1 fingerprint, Games Services will pick it up and associate it as the main Client ID.
Once you link the same app again to your Game Services, it will automatically pick up the other Client ID's
I had exactly the same problem, and in my case, I fixed it regenerating the API Key from the Google APIs Console. Go to Credentials, select your API key and then click on "Regenerate Key". You don't need to update anything in your code or link more apps, just regenerate and it starts working magically.