I need to update an Android app that was developed by someone else. Update by itself is simple, it's simple changes to XML layouts.
So I have a following plan:
update an app (done)
test it on emulator (- maps don't work) stuck here!
test it on devices
release updated version to the store.
Unfortunately I am having mulitple problems with the app.
At first, it doesn't compile because the Project Build Target API was set to Android 2.3.3.
Is there any reason why it wasn't set to Google APIs 2.3.3 ?
When I change it to Google APIs it compiles and runs but I my maps don't display correctly.
All I can see is gray rectangle and annotations on top of it. I am getting following error message associated with it.
05-11 20:45:42.554: W/System.err(598): java.io.IOException: Server returned: 3
05-11 20:45:42.559: W/System.err(598): at android_maps_conflict_avoidance.com.google.googlenav.map.BaseTileRequest.readResponseData(BaseTileRequest.java:115)
As far as I understood from searching with Google and Stack Overflow that might be related to signing up the application. Currently app is using v1 of Google Maps.
Deleting debug.keystore and key set doesn't help.
I am not sure how to proceed with it. Any help will be appreciated.
In order to make maps display you need a signing key that is associated with the API key application was using. Android API v1 is now deprecated, so your options are limited:
contact previous developer and ask them for debug.keystore, which is stored in ~/.android/ or C:/Users/user.name/.android/ directory or
use release signing key for testing (this might be cumbersome)
Depending on what application is that it might also be a good or bad idea to switch to API v2. New API still has some ugly impl bugs, but you won't notice them if maps usage is simple. The API or v2 is pretty good.
Related
I have done an application for android , and I used Android Studio , in this app I need to use Google maps, so while I was working i did all that stuff about the API key to use google maps, i was proving my app on my own movile, and there everything works fine, even googlemaps, but when I put my app on the store, i downloaded it from another device, and there google maps does not work. =(
Do you have any idea why does this happen ?
There might be an issue with your API key for map. (ie. Either there is issue in defining package name or SHA key)
Try to re-generate API key with all proper info. and re-build your project.
Generally created in android studio, a custom application MapActivity, already 4:00 I get it I can not nastroit.V file "google_maps_api.xmp" put the key that was commented above
To get one, follow this link, follow the directions and press "Create" at the end: https://console.developers.google.com/flows/enable... You can also add your credentials to an existing key, using this line: D0:27:4F:13:7E:3A:0A:85:36:D5:4D:44:31:DC:6F:8A:02:7E:5C:3B;com.example.dd.map Once you have your key (it starts with "AIz"), replace the google_maps_key string in this file
that's the key "AIz" I bet when you run applications run tools for viewing Google maps (zoom, zoom out), but the card will not run? Maybe it is necessary to connect to the file, and if so, how? And then how to put all the lessons Google maps, but they are all old, and how to configure them is not written anywhere, and they are all old, tell me how to make what they were loaded?
Have you enabled the Android Google Maps API for your app from developers console? https://console.developers.google.com/ ? That should be the first step. You can do that with the code you have pasted. You can replace the API key (starting with "Alz" . Once you do that, the MapActivity will start working. You should also have google play services enabled. Make sure these are mentioned as dependencies in your gradle build files. Check this thread Android Google Mapview Activity not opening in Android Studio
So I have been having problems getting maps to work on my project and could not figure out why it wouldn't work, so I tested out the maps test application that comes in the services add on for Android Studio but just the menu will work and it still gives me a blank screen for the map even though it shows no errors.
This is a very vague question, I know, but is there something I'm missing?
Did you get an API key for your application?
From https://developers.google.com/maps/documentation/android/intro#sample_code:
Add your own Google Maps Android API key. The package name for the demo app is com.example.mapdemo. Note that the demo app already includes an API key in its manifest file. You will need to replace the key with your own API key.
i have made an android application and in it , there is one scenario when the user clicks on an address and that address shows up on google maps.
Now when i tested the application on the emulator, the google maps did load properly, but now that i am trying the same on my htc desire z, the maps is not loading.
Although the maps application which came built-in in my phone is loading google maps correctly.
what could be the problem? why is my application not able to load the map view?
thank you in advance.
EDIT: i have obtained a google map api key and have included it in the mapview that i am using.i have added overlays and etc. It is all showing fine on the emulator , but on my device it is not showing any maps. The overlays are visible.
There is a difference between a debug maps API key and a release maps API key. With the first it will only run on the emulator.
Unless you have visited the Google site twice (once to get a key which matches the debug keystore and once to get a key which matches your release keystore) then you haven't got a release key and your app won't run on real device.
Our Android developers were also facing this problem. We solved the problem like this:
We generated API keys from each machine and added the Key to their respective main.xml file. So each developer had a separate api key.
We started the emulator from the command line using the android "emulator" command which is located in the tools directory and started with the proxy option instead of starting it from eclipse, eg :
E:>emulator -avd New_Device -http-proxy http://202.0.0.203:808
Most probably, you didn't register your application into the system. This is the link.
http://code.google.com/android/add-ons/google-apis/maps-api-signup.html
If this is not the case, please provide the error details from Logcat.
You need to get an API key from Google.
Here is a good article that explain how to obtain API key.
I am able to see Map in emulator but once I load app on device map does not show up.
Emulator have target as google api 1.6 and device have android 1.6 loaded.
Is this diffrence causing issue?
please help and thanks in advance.
Are you just seeing gray tiles? In that case it's almost definitely the API key that's wrong. The Emulator uses the debug keystore, with androiddebugkey, so you should create an API key for that. Remember to change it when you publish the app to the market =)
Obtaining an API Key
While the problem is most likely the one that Mr. Hedlund suggested...if the built-in Google Maps application also does not work, it is likely to be a problem accessing the Google Maps tile server from the emulator over the Internet. You would need to discuss this with your IT department.
sorry i know its a dead topic but just wanted to add my experience with this;
u need the maps api key to be based off of the current keystore you are using
i had exported my project using a new keystore but a maps key generated from my old keystore. once i used the new keystore to generate a new maps key everything worked
I had the same problem with gray tiles, even though I had created/verified the API key, and had previously had the map working for some time. Turns out at some point, I edited the manifest file and moved the permissions lines. They apparently need to go BEFORE the application element. Thanks to Alan LaMielle (link) for that solution!