Google Api Authentication failed while setting google map api - android

I was using google map API in my app was working fine but yesterday when I added some other feature in the app and started testing it suddenly Map API is no longer working so I thought there may be some issue with the code so I checked and found that I have not changed anything in the map API but when I try to create another app in the Google API came to know that limit is crossed and not even able to see what are the current project I have as the limit is 30 as it says but, in reality, I have used mostly 4-6 app using the API . I looked into other similar questions and tried the same thing but no solution so far. Any solution that may help me will be helpful
I am getting this error while running
Ensure that the "Google Maps Android API v2" is enabled.
Ensure that the following Android Key exists:
the key is there and As i said it was the same app which was working earlier.

Following steps might help:-
1. Login to google devloper console.
2. Select your project
3. Select "Library".
4. Check Maps API if it is enabled or not.

1 => https://console.developers.google.com/apis/credentials
2 => create credentials
3 => Api key
4 => Restrick Key
5 => Application restrictions -> Android apps and API restrictions -> Don't restrict key
6 => Save then wait for 5 min then use generated api key

Related

Android Firebase PERMISSION_DENIED reason API_KEY_SERVICE_BLOCKED

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.

google map api doesn't works with my code

i am using an open source to create city guide application
this source code has a backend which use maps api and it use map api inside the code itself .
it was working well in backend and the apk until i had to change the google cloud account and created another apis from new account .
but now the api which i am using in backend works well , but the another api which i use in source code doesn't works and it shows empty map .
here is the api's setting :
1- Application restrictions : android apps
- i add package name
- i add SHA-1
2- API restrictions Maps JavaScript API Maps SDK for Android Maps
Static API
note : i add a payment in my Billing profile .
i think i did all thing right but don't know why it was working and now it doesn't works
i solved it
the problem happened because i was using SHA-1 for debugging
when i looked at Logcat i found there is another SHA-1 key i should use for release

Google Maps API isn't loading map

I've been trying to get Google Maps working for hours, but all I get is a gray screen. No map at all. I know similar questions have been asked here and I read all of them without getting any further.
A few hours ago I managed to get the Maps working when running the app from my computer, but when installing the APK, it didn't work. So I noticed that there are different API keys for debugging and the release. I decided to start all over again, with generating new keys and so on. So I removed my existing keys from Google, generated new google_maps_api.xml files and followed the instructions.
But now, when running the app from my phone I am getting the following error message:
E/b: Authentication failed on the server.
E/Google Maps Android API: Authorization failure. Please see https://developers.google.com/maps/documentation/android-api/start for how to correctly set up the map.
E/Google Maps Android API: In the Google Developer Console (https://console.developers.google.com)
Ensure that the "Google Maps Android API v2" is enabled.
Ensure that the following Android Key exists:
API Key: (OLD_API_KEY)
Android Application (<cert_fingerprint>;<package_name>): (MY_FINGERPRINT);(PACKAGE_NAME)
So, first of all, how do I ensure that "Google Maps Android API v2" is enabled? On the Google API website I can only find a Google Maps Android API that I enabled. I can't find anything about v2.
And, how can I "Ensure that the following Android Key exists". I removed the OLD_API_KEY because I wanted to start from the beginning. No idea where it is coming from now. I obviously don't have it. So I can't ensure it is there. Why can't I just use a new one that I generated? And why does it even know my old key, that I already removed?
If I understand everything correctly, I am supposed to generate one API key for debugging and add it to my google_maps_api.xml in the debug folder. And for the release I generate another key and add it to the google_maps_api.xml in the release folder. Do I also need to add an API key to my AndroidManifest.xml? At the moment I have this between my application tags:
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="#string/google_maps_key"/>
Where #string/google_maps_key is my debugging key.
My main problem is, why I need to ensure that an old api key exists, that I already deleted. How can I tell Android that I want to use a different one?
I got it working! It turns out that it took a long time until the API keys are actually available to the app. A lot longer than those 5 minutes mentioned on the API page.
So, when you an API key and get the same error message as me, it is probably best to just have a small break and check again in like 20 minutes until the API key is available.

CodenameOne GoogleConnect success callback is not triggered on Android

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.

API Key failure when running Google Map app on Android Phone

I am trying to create a map app with the GOOGLE API, for use on android devices, but I'm fairly new to this so have been following tutorials to get me started. I fixed my initial problem, however another one has appeared and I can't find what's wrong / how to change it!
When running the app through a mobile, it loads onto the phone fine, a screen loads (the sort of beige colour you see when google maps is loading) as well as the logo and zoom controls. But stops after this and displays the following error in LogCat:
Authorization Failure. Please see https://developers.google.com/maps/documentation/android/start for how to correctly set up the map.
Ensure that the following correspond to what is in the API Console: Package Name: com.example.myapp, API Key: [my api key], Certificate Fingerprint [my code]
Failed to load map. Error contacting Google servers. This is probably an authentication issue (but could be due to network errors).
I have completed the steps on the link and checked my code and made sure all those details match, but it's still not working.
This is probably a very basic error, but how would I go about resolving this / Am I looking in the correct place?
[Code no longer here; had to delete it]
If you run the app through Eclipse with a USB connected device, you need to use the MAPs debug key. If you export the app and load the .apk on a device, that app would have to be compiled with the production key.
Last resort: uninstall and re-install app. Clean and rebuild the project is also a good idea
Moreover, please make sure your API key was an Android key, not a browser or server key. Also check that the service is Google Maps API for Android V2, not Google Maps JavaScript API V2.
If you still get any problems, check your set-up against the top answer in this question: Google Maps API V2 - always get authentication error.

Categories

Resources