SO I'm developing an app for android using the groovy plugin.
and I'm facing an issue with google maps where the map loads fine if i set the map activity in the application manifest as the main activity,
but if i set the main activity to be my login screen instead and just go through the application flow, whenever i get to the same map activity, it will not load at all.
and i get the below error in Logcat.
E/Google Maps Android API: Failed to load map. Error contacting Google servers. This is probably an authentication issue (but could be due to network errors).
Give the proper SHA key in the Google console and run time permission for loading the map.
Related
I have setup a compose android app that uses google maps. it works fine requesting permission the first time, but any attempt to run it again I get this error.
Unable to update local snapshot for com.google.android.libraries.consentverifier, may result in stale flags.
java.util.concurrent.ExecutionException: java.lang.SecurityException: GoogleCertificatesRslt: not allowed:
It will run fine again if I wipe the data on the emulator. I know the requests are reaching my google maps platform because I can see the request under metrics.
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.
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 started with the Android Studio default Maps app, which has a fragment named com.google.android.gms.maps.SupportMapFragment, its context MapsActivity.java, and its key in google_maps_api.xml. I went to the URL specified in google_maps_api.xml and generated, then copied back the key provided which starts with AIza. Then I ran the app to test it, but the Maps fragment just displayed a beige rectangle with zoom buttons and the Google logo, and none of these affected the view.
In the console, this error appears every time:
07-22 13:11:48.811 7275-7340/org.bh.app.ourmap E/Google Maps Android API﹕ Failed to load map. Error contacting Google servers. This is probably an authentication issue (but could be due to network errors).
My phone is connected to the internet. Why won't my map display?
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.