question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android - RequestDenied

See original GitHub issue

I realise this is probably something I’m doing wrong but I’ve been banging my head against this wall for many hours and I’m not sure how else I can open a discussion with you @TorbenK

I’ve Enabled the Places API, I’ve enabled Android Maps support, I’ve generated an Android Key and locked it to my package, verified the SHA-1 is correct and verified that the apk I’m using was signed correctly.

For the init calls in your sample you use:

GmsPlace.Init("YOUR API KEY");
            GmsDirection.Init("YOUR API KEY");

Am I supposed to have 2 seperate API keys there or are they the same key? Right now I just seem to have the 1 key which I use for both (Credentials ->CreateCredentials->ApiKey->Android Key). I’ve also tried leaving off the GmsPlace call since I only really need the Direction Api.

I’ve also updated my Android.manifest with:

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

Again, is this the same API KEY I’m using in the above 2 calls?

If doesn’t matter if I switch this to com.google.android.maps.v2.API_KEY instead of com.google.android.geo.API_KEY, I still get RequestDenied.

If I look in the Developer console at my Google Maps API usage, I can see that the calls are coming through and they all have ‘Success’ next to them. The Google Maps Directions API usage though has Client Errors (4xx) next to all of them though.

I was following the checklist from here: http://stackoverflow.com/a/25374435/10957 (Even though it’s for the web service)

Any other ideas? Is there a better error log I can look at to see what the real problem is?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
CliffCawleycommented, Feb 29, 2016

Alright, finally got it figured out.

For GmsPlace.Init and com.google.android.geo.API_KEY in the AndroidManifest.xml you have to use the Android Api key.

But for GmsDirection.Init you have to create a Browser key, otherwise you get the above error. It doesn’t make sense why that’s the case, since the Browser key needs no referrers set, which means anyone can do queries with your key, but that’s the only way I’ve gotten it to work 😕

0reactions
TorbenKcommented, Mar 1, 2016

Doh, yes, of course you need the browser key I simply use the browser API for the route calculation. Seems like I don’t know my own library.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android REQUEST_DENIED Google places API
I am working on Android Google maps application but the query string i am using to get results of places near by the...
Read more >
Request runtime permissions
Diagram that shows the workflow for declaring and requesting runtime permissions on Android. Determine whether your app was already granted the permission. To ......
Read more >
Places Web Service Frequently Asked Questions | Places API
This document contains answers to frequently asked questions about the Places API. If you are unable to find the answer to your question...
Read more >
Request Denied in App - Password compromised?
Request denied in app." My question is, does that mean for a fact that my password has been compromised? I recently changed it...
Read more >
Unlock request denied
Android. The Samsung Galaxy S23 ... Unlock request denied. I have a Samsung S20 FE purchased through Firstnet. Was eligible for upgrade in ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found