Google maps api v2 stopped working - google-maps

Long ago I've setup a Google Maps project using the old API version(v2). I know Google Maps API v2 is being deprecated and I'm working on rewriting it for the new version, but I need this working until then.
Suddenly, the map stopped working throwing this error in an alert box:
Google has disabled use of the Maps API for this application. This
site is not authorized to use the Google Maps client ID provided. If
you are the owner of this application, you can learn more about
registering URLs here:
http://code.google.com/apis/maps/documentation/premier/guide.html#URLs
I haven't changed anything in the current app and the requests per day are less than 1000(way far from the daily quota). The first thing I've noticed is that there was no allowed referrers specified. But even after they was set to(replacing sitename.com with my domain):
sitename.com
sitename.com/*
www.sitename.com
www.sitename.com/*
*.sitename.com
*.sitename.com/*
There was no result whatsoever even after couple of hours. The reason why this application suddenly stopped working is still a mystery to me (once again - nothing has been changed in my code or the google account), but most importantly I need really fast solution.
Any ideas?

Sounds like you might be using v2.x. There was a release of v2 very recently. If you aren't using v2.s; you might try that (or v=2) to see if it resolves your problem (for now, they have gone to a 2 week upgrade cycle on v2: "We have updated v=2.x to 2.441. v=2 will be updated in 2 weeks and v=2.s will be updated in 4 weeks.")

Related

Error GET Google Places API

Today, Google places API stopped working on my site. Yesterday, it was working just fine. When I call it, I get following error in developer's console:
GET https://maps.googleapis.com/maps/api/place/js/AutocompletionService.GetPredictions?1slux&4scs-CZ&9sgeocode&15e3&key=AIzaSyCe8-UQIQuXtaQ5xVOqtwnCtZOjDtXj4Co&callback=_xdc_._8rz5bv&token=109805 net::ERR_ABORTED
The problem isn't in Google maps API itself, because that works just fine (without the Places). If I take fresh code snipper from Google website, it is still not working, as you can see here. So the problem isn't in my code, but in the API itself. I checked my project on Google site and the API is enabled, so it should work. Maybe it's connected to my API key? I haven't tried creating a new one, I don't want to have too many of them.
SOLUTION: After approximately one hour (from posting this), it started working again. Apparently a problem on Google side. So if you have the same problem:
Go to your Google account and check in API manager if the Google Places API service is enabled.
If it is enabled, wait and be patient. Hopefully it will fix by itself.

ExpiredKeyMapError on newly generated API key

I have just generated an API Key to enable us to display a Google map on our website but I'm getting the ExpiredKeyMapError. This is the exact same issue as this stackoverflow query from 8 months ago, but that has never received a solution: Google Maps ExpiredKeyMapError with recently created API Key
When the page first loads, the map shows for a split second and then it disappears, to be replaced with a grey box that says:
"Sorry! Something went wrong. This page didn't load Google Maps
correctly. See the JavaScript console for technical details"
And when I pull up the console, this is the error message I get:
Google Maps API error: ExpiredKeyMapError
https://developers.google.com/maps/documentation/javascript/error-messages#expired-key-map-error
SCRIPT12008: WebSocket Error: Incorrect HTTP response. Status code
403, Forbidden
and that last line just keeps repeating.
Any help much appreciated because I have no idea how to solve this myself.
I had the same error after generating a new API key, but I had JavaScript API already enabled and everything correctly setup.
While searching for an answer and checking what else I can do, the key started to work. So every single time you create a new key, be patient and expect it to work within 1-8 minutes.
I discovered that it was not working because I hadn't separately enabled the Google maps javascript API. Once I'd done that, the map started working a few minutes later.
I discovered that it was not working because I hadn't separately enabled the Places API. Once I'd done that, the map started working a few minutes later.

Google Maps API warning: NoApiKeys

I've been using Google Maps API v3 for some time without an API key, and it worked well.
It still works, but I get a warning in the console:
Google Maps API warning: NoApiKeys
https://developers.google.com/maps/documentation/javascript/error-messages#no-api-keys
I include the script the standard way:
<script src="https://maps.googleapis.com/maps/api/js?libraries=places"></script>
And google.maps.version indicates that I'm using 3.24.2.
In the Google documentation I can only see the different ways to obtain a key, but there is no indication if it's required or not. I noticed the warning today and I'm quite sure it didn't appear a few weeks ago.
Everything is working fine for now, but I'm afraid that maps access without an API key will be ceased in the future. I'm reluctant to register for a key if I don't absolutely need to.
Should I worry about it?
Creating and using the key is the way to go.
The usage is free until your application reaches 25.000 calls per day on 90 consecutive days.
BTW.: In the google Developer documentation it says you shall add the api key as option {key:yourKey} when calling the API to create new instances.
This however doesn't shush the console warning.
You have to add the key as a parameter when including the api.
<script src="https://maps.googleapis.com/maps/api/js?key=yourKEYhere"></script>
Get the key here: GoogleApiKey Generation site
A key currently still is not required ("required" in the meaning "it will not work without"), but I think there is a good reason for the warning.
But in the documentation you may read now : "All JavaScript API applications require authentication."
I'm sure that it's planned for the future , that Javascript API Applications will not work without a key(as it has been in V2).
You better use a key when you want to be sure that your application will still work in 1 or 2 years.
I had the same problem and I found out that if you add the URL param ?v=3 you won't get the warning message anymore:
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3"></script>
Reproduction online
As pointed out in the comments by #Zia Ul Rehman Mughal
Turns out specifying this means you are referring to old frozen version 3.0 not the latest version. Frozen old versions are not updated with bug fixes or anything. But this is good to mention though.
https://developers.google.com/maps/documentation/javascript/versions#the-frozen-version
Update 07-Jun-2016
This solution doesn't work anymore.
Google maps requires an API key for new projects since june 2016. For more information take a look at the Google Developers Blog. Also more information in german you'll find at this blog post from the clickstorm Blog.

Google Maps Android API v2 - Google Play Store is missing

In the newly published version of my app that is using Google Maps Android API V2, I've implemented all the things suggested by the developer guides to ensure the user has GooglePlayServices installed, and it has been working well on all the devices I own and the several hundred people that have updated to the new version of the app so far.
Today I received a bug report via acra with a strange error. This is happening on the following line of code, after setupMapIfNeeded() has completed:
mMap.setMyLocationEnabled(true);
Logcat reports:
W/GooglePlayServicesUtil(10401): Google Play Store is missing.
Shouldn't the call to GooglePlayServicesUtil.isGooglePlayServicesAvailable() also ensure that the Play Store is installed? That seems like a huge oversight on Google's part if it doesn't.
Any help is appreciated.
In case someone came here by accident or was just wondering why it was not working...
This could happen when user had old Android Market installed, which was replaced by Google Play Store.
Here is relevant issue: http://code.google.com/p/gmaps-api-issues/issues/detail?id=4862 (fixed in february update).

Simple API Access status: suddenly INACTIVE

I was developing android application that has backup to google drive feature.
I have used Simple API Access key and it worked like a charm for few weeks.
However, from yesterday, it does not work at all. (cannot list uploaded files and 403 fobidden error when trying to upload new file) I checked Google APIs Console and found out
Simple API Access
Status: Inactive
and Reports is not available and keeps showing popup message "An unexpected error has occurred. We're looking into it."
I googled about this message but there is no solution. (but found several issues related to google cloud SQL)
I was considering to use google drive on commercial level android app and this is very bad...
I wonder what is the problem and how to reactivate api status.
Thanks :)
Unfortunately, because of the security model of the Drive SDK, we need to be sure that an application is who they say they are, which simple access does not give enough assurance of. For a commercial application, this strength of security is great for users.
For a solution, you need to use Google Play Services as outlined in the documentation. We are currently working on a guide to get started with this very quickly on Android, and should be available within the next week.