API keys causing issues - android

In my android app I am using google map and location services.So I generated API key on google developer console for my development work using SHA1 generated by making use of debug.keystore.It worked fine and google map worked perfectly. When I had to release the apk I signed apk following instructions at http://developer.android.com/tools/publishing/app-signing.html#studio.
When I tried to beta test the app, google map didn't work.Visiting the forums told me that I need to generate another google console API key using SHA1 generated by using keysotore which was created while signing the apk.I did same and replaced the key in androidmanifest.xml(So now my project on google console has two API keys,older one I used for development,and newly created one ). But when I regenerated apk and tried to run it on my personal device from android studio, map didn't work.Moreover when I replaced new key by old debug version of key in manifest file and tried to rerun app on my android device map still don't work.So now my older key is also not working while it was working fine before all these changes.
Please help me in this regard.

You should be using the same API Key for your applications but you need to add both the debug and release credentials.
So you will end up with two entries in the android applications:
99:88:77:66:55:44:33:22:11:04:76:99:C3:2A:52:71:7C:64:EC:8B;com.package.app
99:88:77:66:55:44:33:22:11:1C:CC:33:D7:74:A2:49:5D:7D:BF:C6;com.package.app
You can refer to this question for help with the process of adding credentials for each keystore.

Related

Android Google Maps release with other api key does not shows

I have some issue that I have been searching without solution. I had have an app with Google Maps working well, but I deleted the project on console.developers.google.com by mistake, then the app stops to show the map.
I created another project on the console, I generated other api key with Google Maps for Android enabled. Then I changed my google_maps_api.xml value, I cleaned the project, then re-build and created a signed apk, but when install the app the maps not shows it.
I already tried this:
Change to "None restriction" for the key and wait for 24 hours.
I changed the XML attribute to templateMergeStrategy="replace".
Shutdown and turn on my smartphone.
Uninstall and install again my app.
Nothings works
You just declare your google map API key in the debug mode. There is one more google_map_api.xml file in the release folder. It should be like this, just copy/paste your api key.
P/s: Don't forget to switch your Build Variants to release before build signed apk

google map not show in release apk using android studio

I am developing an app, here I'm using google map in debug mode map shows correctly but in release mode map not showing and shows only current location.
By using google map API I have tried but still its not working and also I find the SHA1 by using keystore(i.e. keytool -list -v -keystore file path.jks) then also its not working.
By using following views I tried and found the SHA1 key but map not shown in app.
Release APK file not showing google maps
How do i do?
Have you set your google_maps_key in both debug & release folder in google_maps_api.xml.
If not please, set it. You can find both folders inside Project structure.
See image for reference.
Generate API key access using release key-store. And set Google API console.
Go to google API console.
crate new project
generage API key
enable your service
add API key in your project
OR
You can simply follow this developer guide LINK.
If you have troubling in getting SHA-1 key. You can easily get it by running Signing-report gradle task as below picture (in Android studio).
I solved it by looking at Google Play Console in the left menu select configuration, then integrity of the app and then copy the sha1 of the upload key certificate that is below of the SHA1 Certificate of the app signing key and add it in the same API key of Google Cloud Platform. This way I didn't have to make changes to the apk.
If it doesn't work for you, add both and try.

Android App dev in XDK fails to show map after Publishing

I developed an Android app in intel-XDK using Google Maps Android API key. This works fine in dev and testing on devices. I built the app with the same key in code, jarsigned with my keystore, zip aligned, and published at the Playstore. The Map is NOT appearing in the Product. invalidkey or unauthorisedurl . I pasted the cert SHA1 in dev console for api key too. Googling here and elsewhere for a solution I am still unable to bring the Map on product in Playstore. How should I create the correct key for production ? especially in XDK. Anything missing in my build settings ?

Maps V2 key issue

My com.me.ProjectA is a working app that uses Google Maps V2. I have both Release and Dubug api keys for this app that I got at the Google API console. The app works perfectly.
I copied projectA renaming it to com.me.ProjectB. I tested ProjectB on my device and everything ran fine except, as expected, the map would not show because I still had the api keys for the old namespace of ProjectA in the manifest file.
So, I went to the Google API console and got a new debug api key for com.me.ProjectB using my SHA1 debug fingerprint (That I can get in Eclipse by hitting Windows->Prefs->Android-> build) and my com.me.ProjectB namespace and put this into my manifest file.
So, I think I am doing everything right but when I run it on the device I get no map and I get the messages in logcat saying...
12-14 16:32:34.389: E/Google Maps Android API(30070): Authorization failure. Please see https://developers.google.com/maps/documentation/android/start for how to correctly set up the map.
12-14 16:32:34.399: E/Google Maps Android API(30070): Ensure that the following correspond to what is in the API Console: Package Name: com.me.ProjectB, API Key: AIzaSyAk1dcariCofa7b4pboMGVtReWaDwT_yL4, Certificate Fingerprint: 5A608D32E8A0901CCCD2C519010AD73BE5F609A2 (these are not the real values)
And, of course, the namespace, SHA1 fingerprint, and the API key all match.
Did I forget to do something?
Thanks,
Gary
Have you tried to completely remove the application and then install it all over again. As you said you tried to run the project with the key from Project A. This key might be got cached and even if you install the application with the new key, the old one will be used.
So before you install your application with the new key, try to remove the application completely from the phone.
You can as well go over this blog post I wrote and make sure you do all the steps right in producing the key:
Google Maps API V2 Key

Google maps v2 android api key working only with debug key

I have a problem with Google Maps api v2 on my android app.
I have generated the key for the debug certificate and everything works fine, but I can't make it work with the release certificate.
I've generated the key and the alias with eclipse, then I took the SHA1 which eclipse shows at the end of the "Export signed application" process.
Then I generated the api key for android apps in my google api console using
SHA1;package name
But it doesn't work... it works only with the debug key generated in the same way, only using the sha1 of the debug certificate!
Please help me, otherwise I can't release my app
Check your manifest file, I guess you've forgotten to set your release map api key there while exporting with your release key?
Me too faced the same problem during releasing my app to google Play, when I used Google Maps V2 in my app. After succeeding the issue, I wrote a blog post regarding this you can have a look.
As everyone requested, I would say the answer in following steps
1) Sign up your app using eclipse adt
2) Note down the SHA1 finger print which will be displayed at console of your eclipse adt
3) Again go to google console and get API_KEY for your app by using above got SHA1 fingerprint
4) Replace the old API_KEY with the new API_KEY on to manifest.xml of your app
5) Again sign up your app. Your app is ready to be published. But keep in mind that once you published your app to google market, you should be able to release updates to your app by signing .apk using the keystore which you used earlier for release.
Hope this helps ...
There are two files google maps api.xml, one is the debug and release the other, then you should replace the key generated on google website console and enter this file, another outlet is inserted directly into the manifest.

Categories

Resources