google map not showing in my android studio - android

I actually copied all the code from my friends laptop and everthing worked completely fine except google map. What mighy be the problem?
I have downloaded all google services.

Every debug compiler for every single computer is different. You can create a new key here:
https://console.developers.google.com/flows/enableapi?apiid=maps_android_backend&keyType=CLIENT_SIDE_ANDROID&reusekey=true
or add the new SHA1 to the existed project. Remember, to get the necessary key, you must do the follow:
keytool -list -v -keystore c:\users\your_user_name\.android\debug.keystore -alias androiddebugkey -storepass android -keypass android
Also, you must do the same for the final key when you make a release apk.
EDIT: You can also follow this example to generate a new key: https://stackoverflow.com/a/27639043/3743245

Related

Generate api key for google map while publishing the app

I am trying to do dis more than an hour but unable to find the apt solution.
My app is ready, so i am trying to export it using signed application option in eclipse IDE.
the apk file is getting generated
But the problem is the google map inside map whose API Key was generated using default debug keystore is not working.
So i need to create a new API key by creating a new keystore.
How does it go?
please explain
using your new keystore find the SHA1 key from eclipse and create a new API key for google map.
You don't need another API key anymore, you just have to add the SHA1 finger print of the keystore you use for creating the signed APK to the existing API key:
Supposing you have created your API key in the API Console, go there again and click the 'Edit allowed Android Applications' button below your already existing API Key.
There, add a new line with the SHA1 finger print of the keystore you used to create the signed APK and the package name of your app (it's explained anyways when you hit that button) and you're done.
The Eclipse debug key for signing your application can be found in the userhome/.android/debug.keystore file.
To create the SHA-1 for your debug keystore you use the keytool command from your JDK installation pointing to the debug.keystore file.
keytool -list -v -alias androiddebugkey \
-keystore <path_to_debug_keystore>debug.keystore \
-storepass android -keypass android
Copy the SHA-1 output, as you need this later.
In the console, You need to create a new Android key in pulbic api acccess.
You need to get the SHA1
keytool -list -v -keystore mystore.keystore
You can use this command to get SHA-1 to get Api-Key. Here's link
keytool -list -keystore your_keystore_name
If you don't want to regenerate or re assign the key, then go to Google APi console and Enable the Api-Key for all application either signed or unsigned

Cannot see Google Maps in signed application

I make use of Google Maps Android V2 in my application. When I run my app without signing things are perfect but when I sign my app I cannot see maps. I get lattitude and longitude but I cannot see my maps. All I could see is some blank white space. Please Help. I need to release the project soon..
EDIT
thanks guys i missed the part where I should sign with the app keystore i tried some commands but they didnt work. Tried these
1. C:\Program Files\Java\jdk1.6.0_19\bin>keytool.exe -list -alias compny -keystore
"C:\Users\PC8\Desktop\Sign Key" -storepass compny -keypass compny
and got this error
keytool error: java.lang.Exception: Keystore file exists, but is empty: C:\Users
\PC8\Desktop\Sign Key
2. C:\Program Files\Java\jdk1.6.0_19\bin>keytool -exportcert -alias androiddebugkey
-keystore "C:\Users\PC8\Desktop\Sign Key" -list -v
and got this error
keytool error: java.lang.Exception: Keystore file exists, but is empty: C:\Users
\PC8\Desktop\Sign Key
java.lang.Exception: Keystore file exists, but is empty: C:\Users\PC8\De
sktop\Sign Key
at sun.security.tools.KeyTool.doCommands(KeyTool.java:559)
at sun.security.tools.KeyTool.run(KeyTool.java:172)
at sun.security.tools.KeyTool.main(KeyTool.java:166)
This problem is because of map api key.
You need to sign your app and find .keystore for signed app. Right click on project Android Tools->Export Signed application pachage->next -> create new keystore then use this new keysore to find new SHA1 Now find new API key for your app. And replace the old map API key with this in manifest.
https://developers.google.com/console/help/new/#installedapplications
Next time whenever you want new signed app just use this keystore no need to create new again.
You are now probably trying to work with debug api-key which generated with debug.keystore file. You will have a private keystore file after signing your app. With this keystore file, you should get api-key which is private and named release api-key. Add this api-key to your projects meta-data then it will work.

how to sign in googlemap apk which key i used?

I'm creating Google map application i get my key from cmd using this command and get key from Google console ant tested in mobile is work fine but when i create apk and execution mobile is not show any map if i run directly application from eclipse to mobile is show map whats wrong in my sign in method? what keys i write when making apk
C:\Program Files\Java\jdk1.7.0_21\bin>keytool -list -v -keystore "C:\Users\S-tek
\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass and
roid
You need to use the same key as signing keystore instead of android default keys for getting map api keys .
For example: you are using xyz.keystore file to sign your application then instead of debug.keystore put the path and password of xyz.keystore file to generate the Map api keys.
to sign your apk
first have some tips from official site of android :
http://developer.android.com/tools/publishing/app-signing.html

Map tile not loading only with release certifcate android?

I have checked a lot of questions around map tiles not loading on android device. I have not been able to fix the same error I have.
I am able to test on both emulator and device my mapsview in my application with the debug key. It works absolutely fine. I had generated a maps api key for my debug certificate.
I then created a maps api key for my release certificate with its MD5. I have added that to my maps view and now the application is not working.
I have added android internet permission in the correct place in manifest file.
I have correctly generated the MD5 finger print as I did for debug key.
I have only one mapview in my app so I have just changed that api key in the layout xml.
Only difference in generating key for debug and release is this: In the command options for keytool for the release certificate I was asked passsword only once which I presume is the store pass. my key pass was never asked (actually they are the same)
I generated debug keystore MD5 like this
$ keytool -list -alias androiddebugkey \
-keystore <path_to_debug_keystore>.keystore \
-storepass android -keypass android
I created the release key MD5 like this
$ keytool -list -alias myalias_name -keystore "mykeystorepath"
I have also tested the app with the android store still no luck. What am I missing? Any help is greatly appreciated, thanks guys!
use eclipse for generating the key and exporting, also don't rely on the DEBUG variable( Android: automatically choose debug/release Maps api key? ) to switch at runtime the keys because that's broken at the moment, you have to export the app, get the md5, get the key based on this new md5, switch the map key, reexport
edit:
important steps of https://developers.google.com/maps/documentation/android/mapkey
1) $ keytool -list -alias alias_name -keystore my-release-key.keystore (NOT DEBUG KEY)
2) https://developers.google.com/android/maps-api-signup
3) update code with new key
4) clean project & build (important to clean, eclipse doesn't always do it)
5) export with eclipse
Ok all, here is how silly it was. All was fine except for the fact that I placed the key in a layout file that I was not using. Probably I was out of my mind. So quickly
The maps application will work with release key even if you just export signed application. It is not necessary that the application be put in Android store for it to work. There are some misleading comments in stack overflow that state this.
The keytool will ask for password of the keystore and it will use the same to unlock the alias key too. Only if it is different it will ask again.
The maps application with release key will work with emulator too. Just rmbr to use install adb ""

Android Get MAP key

How to get google maps APIs key.I am running eclipse on Ubuntu and the path /home/tom/eclipse and android is in /home/tom/android or is it that the i need to register somewhere to get the key.Please let me know..
To get the map keys, follow the below steps:
Go To your .android folder in the home directory of the user that have installed the sdk.
Then locate the debug.keystore file.
In command line use the below command to get the SHA1 fingerprint from debug.keystore file.
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
Then copy the SHA1 fingerprint.Go to Googles developer console and create a new project, and there click on credentials. Then create new key. Create new android Key.
Here put your SHA1 fingerprint;your package name.
Then you will get the map key.
And dont forget to switch on the Google map Android V2 to ON in the Google dev console.
I hope this helps.

Categories

Resources