Android Google maps apk showing gray tiles - android

I'm trying to develop a Google Maps V2 based application with android studio on my mac computer. It is working fine while debugging. I've created a map and added a lot of markers, polygons and polylines on it. Looks great!
I'm using real device not an emulator. Real device connected to my computer via USB cable.
But, If I created an APK file with Android Studio and copy this APK file to real device, my application showing only gray tiles.
I've made too many searches but I couldn't find any solution.
Please help.
Problem solved. Thanks to HAR
My mistake was using wrong keystore file. When I use right myapp.jks file problem solved.

The key you obtained and entered in the api console is for debugging purposes. You have to obtain sha1 key for the apk file from the Keystore file which you are using to digitally sign the apk
Procedure for obtaining SHA1 key for release mode
1) Go to the location where you have your 'keystore' file which you are using for digitally signing your application.
2) Open command window in that location. This can be done by 'shift+rightClick' and selecting the option 'Open Command Window here'
3) Use the following Command
keytool –v –list –keystore <name> -alias <aliasname>
where name- your keystore filename
, aliasname - the alias name for the app
4) Then enter your keystore password
5) you will then get your sha1 keys along with other information. Use the key in the api console.

Use Keytool binary or exe to generate a private keystore. Instructions here. You can then sign your app using this keystore. Keytool gets installed when you install Java.
Test sign apk on your real device

Related

Google maps only a grey background as APK

I develop locally with android-studio and a Galaxy S3 android phone connected via USB.
On my local development environment, when I fire up the run configuration to deploy on the S3, everything works fine - the map shows up just fine.
But when I deploy as signed APK to our server, and install via Internet (I am trying on another android phone to keep things clearly separated), the map tiles don't load, I see the Google sign to the lower left and the GPS location icon on the upper right corner.
I've seen a few related posts:
Android Google Maps application showing grey background instead of the map
which seems first a bit dated, second he uses eclipse (I am using android-studio), third - it didn't work for me.
Android - Google Maps Grey Screen on Signed APK
This guy didn't get any useful answers to his question....
The first step is to get the SHA1 value for the key that you used to sign the release version of your app using the keytool command line tool.
keytool -list -v -keystore ~/Keystore/key1.jks -storepass <your_store_password> -keypass <your_key_password>
Replace ~/Keystore/key1.jks with the path and name of the keystore that you used to sign your release version, and replace the passwords with your own.
When you execute this command at the command line, it will list the Certificate Fingerprints, including the SHA1 value that you need.
The next step is to add the SHA1 and package name to a key in the Google Developers Console.
You can either add it to the same key you used for debug builds, or you can create a new key.
To add your release SHA1 and package name to an existing API key, click the Add package name and fingerprint button, and add your SHA1 value and package name.
Then, you can use this API key with the signed release version of your app.
For more information on how to configure your app if you use a different API key for debug and release, see here.
Step 1: Follow the instructions from here:
http://developer.xamarin.com/guides/android/platform_features/maps_and_location/maps/obtaining_a_google_maps_api_key/
Step 2: Then from your Android Studio, follow the steps described here:
https://www.udacity.com/wiki/ud853/course_resources/creating-a-signed-apk
I faced a similar problem and had it solved by doing the above.

Getting Android Google Map v2 working in release version by generating SHA1 fingerprint for API key

I spent a long time tonight trying to figure out how to get my Google Map that worked in the debug version of my Android application to work in the release version. There were a few different problems that came up. Some fragments of Stack Overflow posts helped, but I thought it would be useful to list more detail for the whole process, including the problems I had, which were:
1) How/where do you specify something different for your release version?
2) How do you run the keytool executable needed to get the release version fingerprint?
3) Why was I getting the "keystore file exists but is empty" error when running keytool?
1) As specified in a couple other Stack Overflow posts, you can use the same Google API key for both your debug and release versions, but you have to supply the fingerprints of your debug and release keys in the Google Developers Console.
Log into Google Developers Console https://console.developers.google.com
Choose your appropriate Project
On left side, choose Credentials under "APIs & auth"
Assuming you already have an API Key generated for Android applications, you should already see your application listed as an "allowed application" with its debug fingerprint. Click "Edit allowed Android applications".
You will want to add another line for your application, but with its release fingerprint. To get that...
2) Google mentions in that dialog that you need to run
keytool -list -v -keystore mystore.keystore
But by clicking "Learn more" and going a little further, what you really want to run is
keytool -exportcert -alias MY_RELEASE_KEY_ALIAS -keystore MY_FULL_PATH_TO_RELEASE_KEYSTORE_FILE -list -v
Then you'll be asked for your keystore password. One piece that isn't mentioned in the docs is where the keytool program is. Its in your JDK bin folder. So on Windows, something like C:\Program Files\Java\jdk1.8.0_20\bin
3) After I opened a console window in the Java bin folder and ran the keytool as above, I was getting an error that said "keystore file exists but is empty". Eventually I realized that when specifying the full path to my release keystore file, I had only specified the folder name but forgot to include the actual file name, even though there was only one file in the folder. So MY_FULL_PATH_TO_RELEASE_KEYSTORE_FILE above should include the .keystore file name
After all that, you will be finally be provided with several fingerprints, including the SHA1. You can copy that, and go back and paste it as a new line in the allowed Android Applications, with your package name on the end separated by a semi-colon, just like the debug one.
Follow the instructions given here. After creating your project in Google Developers Console, select APIs, you will be prompted with a section of Popular APIs, select Google Maps Android API. Press enable API.(the image below is showing the steps in the new version of the console)
If you're still using the old console, enable the API, by selecting Services, then switch the button ON:
Note:
You don't need to enable the API for the debug version!
If you're map is still not showing try regenerating the key!
(new version)
(old version)
Enter the new API key then Sync Project with Gradle Files!

Map is not working after installing from play store in android

I'm stuck in this issue, when i run my project in eclipse it shows map correct, but when i upload it to Google play store and when i install it in my device , it shows the blank map,
I don't know what is a problem my map key is correct, package name is correct, i also generate new map key and try, but it also doesn't work. I don't know where is the issue.
Please follow the check-list :
1) Sign the app with new .keystore.
2) SHA1 of new .keystore should be used.
3) Map key should be made using this SHA1.
4) If new Google account is used, then make sure Android Maps V2 services is turned on for that account.
As this type of issue was already raised and there was the solutions
Google Map Android API v2 can't display map in play store application
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.
Next time whenever you want new signed app just use this keystore no need to create new again.
Make sure you update the SHA-1 in the play store from the location
Select your App --> App Integrity --> App signing key certificate --> SHA-1 certificate fingerprint.
Paste it into Release Key along with the app package name.
You need to do the following things to get your Maps Visible for both Debug Mode and release mode
-1 Add debug key to package combination at Google API console
-2 Add release key to page combination at Google API Console
Note : you need to add at lease 2 combination to get your maps visible when you are testing and when you generate *.apk file.
What you are missing right now is not adding the release key to application package combination to API console add this and after that do the following:
replace your debug map key with release key and generate your *.apk and install aplication to your device you will get your maps
there are several Tutorial available on net i would to suggest you the following one
Google Maps
To Generate the Release key do the following steps
Open CMD (in Windows) terminal (in Linux?MAC os) find the path to your jdk dir and then to bin like following:
C:\path-to-jdk\jdk1.7.0_07\bin>keytool -v -list -alias tt -keystore path-to-keystore -storepass password -keypass passowrd
for me the path is following for Jdk/bin and that for key store
C:\Program Files\Java\jdk1.7.0_07\bin>keytool -v -list -alias tt -keystore D:\ke
yStore -storepass password -keypass password
you need to give the following things of your own
-1 path to jdk
-2 path to keystore
-3 keystore passoword
-4 keypass password
Also look http://android-er.blogspot.in/2012/12/displaying-sha1-certificate-fingerprint.html for more information

android map v2 won't show in debug mode

do i have to publish the apk everytime in order for the map to show? My map won't display while running via eclipse, i have to export to apk and then install on my deivce to test. Is there a easier way to test a map v2 apk? Thank you!
First thing you have to Use your debug.keystore file from .android folder and then generate SHA1 using that keystore.... in Command Propmt.
And then you have to generate your Google Map v2 API key using this SHA-1 from Google API Console.
And use this key in your application and you don't need to Export your Signed application..
Thanks..!!
You can't display maps in the Emulator since it doesn't have Maps installed in it. You must run all the Maps related applications in your android device.
Also, Just connect your device to the PC/laptop and eclipse will automatically prompt in which device you want to run and then you can select your device.
Its because there is no maps in your emulator. Your map will display only on a pure AVD, i.e. it CPU of emulator must be ARM, and the target should be a Google APIs device. For Maps V2, you need google play services installed in your emulator/device. By default its not available in any emulators.
You can force install google play services into an emulator, follow this for a start.
The better option is to use a device(mobile/tab) via USB with developer options enabled (USB Debugging checked).
Try it...
Use this command to generate SHA1 certificate with your debug.keystore, than generate API key with generated SHA1 certificate
How can I get the MD5 fingerprint from Java's keytool, not only SHA-1?
After generating key from API console use that key to your Manifest file.
There is, but you need to modify your debug key in eclipse (I'm assuming you are using eclipse).
First off, The google mapview stuff only shows when the Api key you are using is derived from the signing key. Here lies the problem - eclipse uses its own default key when you're launching from the IDE.
So you need to use your actual signing key for the debug. If you go to Window -> Preferences -> Android -> Build, you will see that eclipse is using a default debug keystore.
You have there the option to use a custom debug keystore. BUT NO WAY TO SET CUSTOM PASSWORD.
Good thing you can change the password on your original signing key (I prefer to create a copy and tag that as my "debug" key) and still retain all/most of its properties, I honestly don't know which ones, such that you can now use it as a debug keystore and still have it display the google maps layout.
To change keystore password just fire up cmd and do:
keytool -storepasswd -keystore my.keystore
Eclipse uses "android" as the default password for debugging, that's what you enter as new password.
After modifying your key, you can now set it as the custom debug keystore and start going Ctrl+F11 on your android source.
As far as I know, you can even override installation of the normally-signed app on your phone with this technique, so it goes further than just having google maps enabled while debugging.
C:\Program Files\Java\jdk1.7.0_03\bin> keytool.exe -V -list -alias androiddebugk
ey -keystore "C:\Users\Dell.android\debug.keystore" -storepass android -keypass android
type this in CMD.this will give both sha-1 and md5 key..plz change path as per ur machine..!
Make sure that the release API key is in the google_maps_api.xml file under the release/res/values folder, since this is the one that will be used for the signed release apk.

Android Google Maps API Key

I'm developing an app that uses Google Maps. I got the debug keystore and got the API key to work while I am debugging my program in Eclipse, but I am thoroughly confused in how to change this so that it works on an Android device when I export the .apk. I have searched around Google, but am mainly finding things that use the debug.keystore and I don't think this is what I want to use when I deploy this on an Android device, because I sent my .apk to a friend and he said he is getting gray boxes on the Map View.
Can anyone fill me in, step-by-step, on how to correctly make a new keystore for my app and how to sign my app so that it will work outside of debugging on Eclipse? A video tutorial would be preferable, but if not, simple 1-2-3 step type instructions would work. Thanks!
Eclipse (through ADT) has a nice wizard that lets you create a real keystore and build a signed apk. Right click your project, then Android Tools -> Export signed Application package
For the google maps key just follow these instructions
head to the command prompt, (I use windows so I'm going to go that route but same general idea for the other OS's)
The keytool program you'll need is part of the JDK so you do have it if your able to compile the apps at all. but it may not be on the app path so you can't just type it into the command line to be used.
for me it was in:C:\Program Files\Java\jdk1.7.0_21\bin so to get it on the app path I typed this in set PATH=%PATH%;C:\Program Files\Java\jdk1.7.0_21\bin
next you need to change to the directory your keystore files are in for me that is: C:\android\keys so I used the command cd C:\android\keys to change to the proper directory
then you need to run the keytool with the proper settings so it knows your after the key and not trying to do something else. the command I used was: keytool -list -v -keystore Testkeys and Testkeys is the name of my keystore use the name of your keystore there instead.
Last by not least it will spit out a whole bunch of different information but the one your looking for will look something like this
SHA1: A1:DF:83:DD:04:B2:26:10:B2:EB:26:00:90:75:D0:10:66:5E:A9:8A
you want all the numbers and : that are after the "SHA1: " that is your app key for the published version of your app, the one you need to register with the google maps api service, and then they will give you a new map api key that you need to put in your project and then republish it, and then the maps will work.

Categories

Resources