Udayaditya Barua
Udayaditya Barua

Reputation: 1162

Android Google Places API "PLACES_API_QUOTA_FAILED"

Ok, so I am kinda new to Google maps/geo etc. So I went to the Google console, added an application, enabled "Places API for Android", copy pasted the API key like this :

<meta-data
        android:name="com.google.android.geo.API_KEY"
        android:value="API-KEY" />

I have an activity where I did

mGoogleApiClient = new GoogleApiClient.Builder(this) .enableAutoManage(this, 0 /* clientId */, this) .addApi(Places.GEO_DATA_API) .build();

Copy pasted the adapter from the samples code. Everything compiled fine, autocompletetextview was setup properly and all.

Now when I started typing, it throws an error immediately Error getting autocomplete prediction API call: Status{statusCode=PLACES_API_QUOTA_FAILED, resolution=null}

I searched and searched and guess what, google doesn't even have this error code in their documentation! Has anybody faced this? Am I missing something here?

P.S - I added the app a day ago so definitely my quota is not over. Also its a different error code for exhausted quota.

Upvotes: 2

Views: 1362

Answers (6)

Siddharth
Siddharth

Reputation: 9574

This happened with me when using genymotion. This also happens on devices and emulator. With me I choose Run option from `android studio. Which does not build a signed APK. Google Map services need a signed apk for running.

Build a signed APK and drag and drop it into genymotion (install it using adb install) for it to work.

Upvotes: 0

Rem-D
Rem-D

Reputation: 675

I changed my package name during the development stage. After changing the package name on the Developers Console api key apps I came across this error. The solution was to simply wait 5 minutes or so after changing the key in the Developers Console. The Developers Console does clearly state this but it's easy to ignore.

Upvotes: 0

raluca
raluca

Reputation: 458

I had the same issue. For me the problem was fixed by enabling the api via:

https://console.developers.google.com/flows/enableapi?apiid=placesandroid&keyType=CLIENT_SIDE_ANDROID&reusekey=true

and regenerate key as a server one

Upvotes: 1

Diogo Paschoal
Diogo Paschoal

Reputation: 1667

In my case, the error was generated because a new sdk and android studio install. So, just following the steps in the Google tutorial solved the problem: https://developers.google.com/places/android/signup#find-cert

Upvotes: 0

Udayaditya Barua
Udayaditya Barua

Reputation: 1162

So, the problem was, I had generated an "Android Key" (which I thought was logical because I was developing an android app). That didn't work and gave me this confusing code. Then I went back, deleted that key, and generated a "Server Key" and pasted that code in the app manifest. Guess what, it worked!

Most peculiar behavior and this step is not even mentioned in the documentation as to why this is logical.

Upvotes: 2

Francois Wouts
Francois Wouts

Reputation: 3962

Sorry about this confusing error code—we're working on getting that fixed.

This could be due to an incorrect certificate fingerprint in your Developers Console configuration. Would you mind double checking the instructions at https://developers.google.com/places/android/signup#find-cert?

Let me know if that works.

Upvotes: 4

Related Questions