I'm doing a project with two colleagues using Android Studio, where we need to use google maps, however this problem has appeared everytime. When I compile and have the app running on my pc Android Studio everything works great and google maps works however when I send the project to either one of my colleagues when they try and run the app on their phones Google Maps only shows a grey screen, showing only the buttons but not the maps. We share the same keys generated by myself. The minSdkVersion implemented on the project covers all our phones. We have tried several things and none of them seemed to solve problem, like generating different keys for each one of them.
The only thing that seems to work is if I run the app using their phones through my computer, it's the only way that the app will show the maps.
Any help would be appreciated
The API key you've generated does not match their keystore. This key is generated with the SHA1 of your keystore. Make sure you all have the same keystore. Each install of Android Studio creates a new debug-keystore. You should make sure you use the same keystore.
Related
Okay, so here is my problem:
I made a little app for myself that uses the Maps API from Google. I followed the instructions on how to put the API key in the app and all that. I make my app, run it on my phone (via USB debugging if that's important) and it works just fine. Now, out of fun, I put the app on Google Play Store (for some of my friends and family to use it idk), and all of a sudden, the app doesn't work. What happened was, the map wouldn't load (as if i haven't put in the API key). Then I uninstalled the app, tried running it with USB debugging again, and the same thing happened. So I put in the new API key, and it works just fine. Uploaded the version 2 in the Play Store, same problem and the same situation. How do I fix this?
I will provide any additional information that you need.
Check if you've entered your API key within the google_maps_api.xml file in the release directory (/app/src/release/res/values) just like in your debug directory (/app/src/main/debug/values).
Then, if you have API key restrictions make sure that you are using right certificates for the debug and release builds. You can get your debug and release certificates by following the steps given on Google Maps SDK for Android documentation
I hope this helps! Goodluck on your project
so I'm currently developing my first app. I'm just creating a simple map app with different markers on it.
So it's all working perfectly well in the emulator. But when I run the published .apk on my phone, the map doesn't show. It has the GUI but there aren't any continents.
Does this have something to do with the API I got?
Note: I'm running the app on my Samsung Galaxy S6.
You need a new API key (generated with a release certificate) for the signed apk. Simply follow instructions on this page: https://developers.google.com/maps/documentation/android-api/signup?hl=en#release-cert
You'll find information you need under Display your app's certificate information title, RELEASE CERTIFICATE section.
I have a little problem. I have created an android api that uses google maps(mapview) on my pc with eclipse and the android emulator. Everything seems to be running fine on my pc, but when I try to install and run the same api on my laptop everything runs great, except that when I navigate to the activity using the mapView, the map shows grey with grids on the screen and not as a map. Could the problem be, that because I am running the api on a different pc, I should create a new api key to use? In another topic, I have seen that a possible solution could be, to change the version of the java compiler to the one that the program was originally compiled. I tried this too to no effect. Any help would be useful.
The Google Maps API key corresponds to your app key, when running the app locally without signing it with a keystore the app is signed by the eclipse debug key (which is different for every computer), so you need to create a new API key for every debug keystore you're using. To sum it up, you need a different API key for each development computer and off-course another API key for your release keystore.
You need to share the debug.keystore between machines for the map to show on different machines while development.
For that in Eclipse, go to Preferences -> Android -> Build and set the Custom debug keystore appropriately which u are using on your pc to view Google Maps.
Or else create a different API key for each development computer.
You will have to create a separate keystore for the release of the app.
most people have the opposite problem that I do.. I have no issues on the emulators (API keys should be correct). But when I take it to my tablet.. I don't get anything..
do the apps needs signed to touch base w/ google maps (when installed on a tablet/phone)? Getting apps signed has not been working out well for me.. even got an error trying to say my debug.keystore has been manipulated?
If someone has a very nicely laid out walk through for creating the key I would be greatly appreciated. I've tried this in eclipse and through command prompt.. Nothing but issues.
It sounds like you copied your project from some other place. Try to go through the directory of your project and delete anything that you don't think should be in there. Delete any generated files or keystores you find in there. Rename the package to your own package name, please do not pick com.android. And then, rebuild everything.
Or better yet, create an android project from scratch, and put in the minimum code that will render a map, and then test it on a phone to see if you get the same result.
And then, test it on the tablet after that (you say it hasn't worked on the tablet, but I remain unclear as to whether you tested it on a phone too).
And do not sign anything, just connect it to your tablet with the usb cable, set your tablet to debug mode, and select run as an android application (Eclipse will do the rest with the debug.keystore and the signing).
And by the way, starting in Android 2.2 or 2.3, the google map API keys don't need to be correct anymore to work on the emulator I believe. The complaints you found probably predate this change.
I hope that I can be clear; I know there are a lot of threads on the Google Map API, but I have exhausted my brain trying to fix my problem with the maps. Please tell me what I have wrong here.
I understand there are two Google Map API keys.
1) API key, for a market published app. Maps will appear once the app is published.
2) Debug API key, only works on emulator or side loaded to the phone for testing.
My partner and I are working on an app together from different PC’s. We each have our own debug api key.
1) He sends his app folder from his .android folder
2) I drop the files into folder in my .android folder
3) I import the project into eclipse
4) Replace his API key with mine.
5) Run application
He gets maps displaying on his application, but I do not. I get the gray grid.
Do I need to build a new APK of the app before the maps will appear? Does this new APK have to be created exactly like he did his?
Does the path to my APK need to be in the same folder as my keytool.debug?
How does the fingerprint relate to the APK?
Please clarify, we are stumped.
The maps API key is linked to the keystore which was used to register. You will need the debug.keystore that was used to register for the API key. Here are some quick instructions I found on how to do this.
Sharing one keystore is much easier than changing the reference to a new maps API key every time you make a revision. I'm not sure why your method isn't working though.