admin管理员组文章数量:1304589
I’m encountering an issue when trying to use the Google Geocoding API in my Android app. When I make a request, I get the following response:
{
"error_message": "This IP, site or mobile application is not authorized to use this API key. Request received from IP address XXXX, with empty referer",
"results": [],
"status": "REQUEST_DENIED"
}
What I’ve done so far:
API Key Setup:
I created an API key in the Google Cloud Console. I restricted the key to Android apps by specifying the package name and SHA-1 fingerprint for my app. Geocoding API Enabled:
I’ve enabled the Geocoding API in the Google Cloud Console.
API Key Restrictions:
I did not set any IP restrictions because I’m testing it on an Android app. I have package name and SHA-1 fingerprint correctly set for the app. Testing the API Key:
I tested the API directly in Postman and got the same REQUEST_DENIED error with a message indicating that the IP or mobile app is not authorized.
What I need help with:
Why am I getting the REQUEST_DENIED error for an Android app, even after setting the package name and SHA-1 fingerprint? Is there anything I might be missing in the API key setup or Android configuration? Should I remove IP restrictions even if I’m testing on Android? Are there any additional settings or troubleshooting steps I should take?
Here’s the request I’m making:
.4236,-122.0838&key=XXXXX
I suspect this issue is related to HTTPS. Could you recommend the correct way to implement the Geocoding API in an Android Java app?
Thanks in advance for your help!
本文标签: javaGetting REQUESTDENIED error in Android app with Geocoding APIStack Overflow
版权声明:本文标题:java - Getting REQUEST_DENIED error in Android app with Geocoding API - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741783735a2397459.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论