Google map not working after publishing app on play store - google-maps

I published app three days before, The map was working before, but now map stopped working. I added the SHA1 key in the google console. Do I need to create 2 different API key for debug and release?
Now while I am checking the un-signed app, the map is not working.

You need another API key for your release build if you want to restrict it (which is strongly recommended), because you'll need to get the SHA-1 fingerprint for your release certificate. The debug one won't work.
You can follow the instructions from Google's documentation.
Also make sure that your API key is set in your google_maps_api.xml file within your release folder and in your AndroidManifest.xml file.
Hope this helps.

Related

How can I check whether Google keys are embeded/enabled in Chromium/Chrome or not?

I build Chromium with Google keys (Google API, Oauth Client ID, Oauth Client Secret).
I could embed above Google keys well in Chromium source before building.
But I wanna check the keys in Chromium binary after building.
If I type chrome://version in Chromium, can check flags which r adopted in Chromium browser. But I don't know how to check the keys.
Or I just wanna check whether the keys are enabled or not.
Is there a way to check whether Google API is embeded/enabled in Chromium/Chrome or not?
Chromium will first try to read the value of these env. variables from the system before using embedded API keys, if they are present:
GOOGLE_API_KEY
GOOGLE_DEFAULT_CLIENT_ID
GOOGLE_DEFAULT_CLIENT_SECRET
if they are not present then it will use embedded values instead.
There are a couple of ways to find out if a Chromium fork was compiled with Google API keys:
If the API keys are absent, Chromium will show a bubble control on startup stating that API keys are missing. But as mentioned above, you can't find out if the API keys are embedded or read from env. variables using this method.
Use Chrome sync feature to check if Google API keys are present or not. Just try to sync Google accounts with Chromium. If they keys are not present then it won't work. FYI, this feature won't be available to Chromium browsers past March 15 because of policy changes led by Google.
Again, you can't use this method to find out if the API keys are embedded or not.
Use this method to find out if the API keys are embedded you can find out by enabling logging when starting Chromium. You should go through the log file to find out if the API keys are being read from env. variable or are embedded. More info on how to enable logging: Here

Google Maps Android API: Authorization failure. Ensure that the "Google Maps Android API v2" is enabled. Ensure that the following Android Key exists

I am getting this error:
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: [The key...]
Android Application (<cert_fingerprint>;<package_name>):
Instead of the map working correctly, this is what I see:
In my app/build.gradle, I have this:
implementation 'com.google.android.gms:play-services-base:16.1.0'
implementation 'com.google.android.gms:play-services-analytics:16.0.8'
implementation 'com.google.android.gms:play-services-awareness:16.0.0'
implementation 'com.google.android.gms:play-services-cast:16.2.0'
implementation 'com.google.android.gms:play-services-gcm:16.1.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
play-services-location is what I need for the Google Maps, correct? I was looking at the list at https://developers.google.com/android/guides/setup and I assume that Google Location and Activity Recognition - com.google.android.gms:play-services-location:16.0.0 is what I need for Google Maps. Is this correct?
UPDATE 1: I already have Maps SDK for Android enabled:
The error says: Ensure that the "Google Maps Android API v2" is enabled.. Is it referring to the Maps SDK for Android that I am showing in the screenshot in this UPDATE 1?
UPDATE 2: I have Maps SDK for Android enabled:
When I click the MANAGE button, I can go to the section to configure credentials that I showed in UPDATE 1.
UPDATE 3: I see the Map displayed correctly on all versions of Android on the Emulator. But on physical devices, the map never shows up. I see the Google logo and the red balloon, but now the map when I run the app on physical phones. Only on the Emulator everything works. Any ideas why?
UPDATE 4: See my solution at https://stackoverflow.com/a/56307654/4242086.
Hey I had the same problem today!,I solved it very easy for first you have to go https://console.developers.google.com and enable the android SDK maps and then create the api key, return in xamarin go to your manifest and add the google maps api key
https://learn.microsoft.com/it-it/xamarin/android/platform/maps-and-location/maps/obtaining-a-google-maps-api-key?tabs=windows
This is the documentation
(I typed this fast because am on mobile now sorry)
follow to below link for generate google api key:-
https://developers.google.com/maps/documentation/android-sdk/map-with-marker
Android Code Reference Link:-
https://www.zoftino.com/android-mapview-tutorial
I followed this tutorial and I was able to fix it: https://www.youtube.com/watch?v=sJBlQv6IptQ. The video makes references to this tutorial: http://ramsandroid4all.blogspot.com/2016/01/google-maps-android-example-in-android.html.
In my case, what I did was to create a new project at https://console.developers.google.com/. I used Android apps for Application restrictions:
For the Restrict usage to your Android apps section, I had to provide a Package name and a SHA-1 certificate fingerprint. The Package name was in my app/build.gradle, specifically here:
applicationId "[my package name]"
The SHA-1 certificate fingerprint I found it from Android Studio by running signingReport:
The result included something like this:
Alias: AndroidDebugKey
MD5: [The value]
SHA1: [The value]
SHA-256: [The value]
Valid until: Wednesday, May 5, 2049
----------
BUILD SUCCESSFUL in 0s
1 actionable task: 1 executed
16:31:44: Task execution finished 'signingReport'.
Now the map works correctly in my Android app:
UPDATE 1: To my surprise, the maps were working correctly only on the Android Studio Emulator but not on real Android physical devices. The solution was what I posted at https://stackoverflow.com/a/56307654/4242086.
I got the exact same symptoms when I moved the project to a new computer. My solution was to generate a new key based on the error message. The google_maps_api.xml file had an URL in a comment to generate key but that is a static thing, so after moving the project to a new computer I rewrote the URL to match the error message's version.
https://console.developers.google.com/flows/enableapi?apiid=maps_android_backend&keyType=CLIENT_SIDE_ANDROID&r=[put-the-thing-here]
Generated the key, put it in the XML file and it worked well.
In my case, I did everything right. but was still getting the error it turned out that changing the attribute "android:name" in the manifest file solved the issue.
Change
android:name="com.google.android.maps.API_KEY"
To
android:name="com.google.android.maps.v2.API_KEY"
Time changed the configurations steps. Here the new one.
Set up your project https://console.cloud.google.com/projectselector2/home/dashboard
Enable Google Maps API. Go to https://console.cloud.google.com/apis/library?filter=category:maps&_ga=2.192684329.2027491681.1618180744-3962552.1609436892 choose the API you want to enable
Go to API Credentials https://console.cloud.google.com/project/_/apiui/credential of your project
On the Credentials page, click Create credentials > API key.
The API key created dialog displays your newly created API key
Click Close.
In Android Studio, open your app-level build.gradle file and add the following code to the plugins element. id 'com.google.secrets_gradle_plugin' version '0.5'
Save the file and sync your project with Gradle
Open values\google_maps_api.xml and replace YOUR_API_KEY with the API got in the point 4.
Check in your AndroidManifest.xml the MAPS_API_KEY is replaced with your actual key
android:name="com.google.android.geo.API_KEY"
android:value="${MAPS_API_KEY}" />
Insert in your AndroidManifest.xml
<uses-permission android:name="android.permission.INTERNET" />
Go to the APIs & Services > Credentials page https://console.cloud.google.com/project/_/apiui/credential
Select the API key that you want to set a restriction on. The API key property page appears
Under Key restrictions --> Select Android apps.
Click + Add package name and fingerprint.
Enter your package name and SHA-1 certificate fingerprintClick Restrict key.
Select Maps SDK for Android from Select APIs dropdow
To finalize your changes, click Save.
For those who still haven't figured it out yet, again take a look at the logging below the error message. Pay close attention to your certifcate_fingerprint and package_name printed out in the logging. Compare these diligently with the ones specified in your Google Development Console.
I picked up an old hobby project again after almost an entire year of inactivity. I probably changed something somewhere that triggered a change of the certificate fingerprint, or visa versa.
Hope this helps!

Google Maps API warning: NoApiKeys

I've been using Google Maps API v3 for some time without an API key, and it worked well.
It still works, but I get a warning in the console:
Google Maps API warning: NoApiKeys
https://developers.google.com/maps/documentation/javascript/error-messages#no-api-keys
I include the script the standard way:
<script src="https://maps.googleapis.com/maps/api/js?libraries=places"></script>
And google.maps.version indicates that I'm using 3.24.2.
In the Google documentation I can only see the different ways to obtain a key, but there is no indication if it's required or not. I noticed the warning today and I'm quite sure it didn't appear a few weeks ago.
Everything is working fine for now, but I'm afraid that maps access without an API key will be ceased in the future. I'm reluctant to register for a key if I don't absolutely need to.
Should I worry about it?
Creating and using the key is the way to go.
The usage is free until your application reaches 25.000 calls per day on 90 consecutive days.
BTW.: In the google Developer documentation it says you shall add the api key as option {key:yourKey} when calling the API to create new instances.
This however doesn't shush the console warning.
You have to add the key as a parameter when including the api.
<script src="https://maps.googleapis.com/maps/api/js?key=yourKEYhere"></script>
Get the key here: GoogleApiKey Generation site
A key currently still is not required ("required" in the meaning "it will not work without"), but I think there is a good reason for the warning.
But in the documentation you may read now : "All JavaScript API applications require authentication."
I'm sure that it's planned for the future , that Javascript API Applications will not work without a key(as it has been in V2).
You better use a key when you want to be sure that your application will still work in 1 or 2 years.
I had the same problem and I found out that if you add the URL param ?v=3 you won't get the warning message anymore:
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3"></script>
Reproduction online
As pointed out in the comments by #Zia Ul Rehman Mughal
Turns out specifying this means you are referring to old frozen version 3.0 not the latest version. Frozen old versions are not updated with bug fixes or anything. But this is good to mention though.
https://developers.google.com/maps/documentation/javascript/versions#the-frozen-version
Update 07-Jun-2016
This solution doesn't work anymore.
Google maps requires an API key for new projects since june 2016. For more information take a look at the Google Developers Blog. Also more information in german you'll find at this blog post from the clickstorm Blog.

Google Map Show blank Map

help me please...
for a very long time i have a problem.
i was made android application which implemnet google maps with eclipse. I have following a lot of tuorial from google. All of them failed. After I installed in my device, program just showing blank white map with only zoom control and sign google. I was put all of permission needed in my manifest, i have my apikey which i get from my SHA1. I got my SHA1 from windows - preference - android - build. I also tried to get my SHA1 from commandprompt and have the same result. Android google map v2 was switch on.
somebody, help me please.. whats wrong with my program..
I also had the same problem, in my case it was due to API KEY it was not correct. I regenerated key with SHA1 and problem solved.
This link has sample code you can download and check
You must get API key from Google Console by the link that provide into google_api.xml in android when create map activity in android studio.
so you copy API Key from google console and past into google_api.xml where YOURKEY HERE.After you must go to Google Console and enable key so it will work.
In my case it was an existing app that I cloned from GitHub.
What worked for me is to enable the SHA-1 of my signing certificate. Follow these short instructions.
Then I had the main developer add my SHA-1 fingerprint to the authorized packages for his relevant API Key here (in his login). Then it worked.

Google Drive API - Authorization for Downloads Post 1.70 Beta

I updated by Google Drive SDK references to 1.70 recently and updated all of my authentication code from using IAuthorizationState and the NativeApplicationClient to using UserCredentials, Drive.Auth.Store, and a DriveService object consistent with Google's "supported" method.
Everything working with my DriveService is working great. I can upload files, list files, create files and folders. Now I'm trying to figure out how to perform the simple act of downloading files by ID and I can't determine how I can leverage my new authentication code to support downloading. The SDK examples are referencing IAuthenticator but I'm not sure if that is a legacy object and my current project can't naturally reference it (missing a reference or perhaps isn't in 1.70).
I recognize that the Drive SDK may not actually have a method of downloading a file, but I'm very confused about how I can use my clean, new authentication store (Drive.Auth.Store) which has everything I should need to authenticate with the downloading action.
A point in the right direction would be most helpful! Thanks in advance for your help.