Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/220.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android Google未授权放置Api密钥_Android_Api_Google Api_Google Places - Fatal编程技术网

Android Google未授权放置Api密钥

Android Google未授权放置Api密钥,android,api,google-api,google-places,Android,Api,Google Api,Google Places,我在android应用程序中使用google places,我收到了这个错误 { "error_message" : "This API project is not authorized to use this API. Please ensure that this API is activated in the APIs Console: Learn more: https://code.google.com/apis/console", "html_attributions"

我在android应用程序中使用google places,我收到了这个错误

{
   "error_message" : "This API project is not authorized to use this API. Please ensure that this API is activated in the APIs Console: Learn more: https://code.google.com/apis/console",
   "html_attributions" : [],
   "results" : [],
   "status" : "REQUEST_DENIED"
}
我已经尝试使用Android密钥、浏览器密钥和服务器密钥,但这不起作用,请帮助我,我不知道密钥有什么问题。。。!! 请帮帮我 我正在使用的URL是:

https://maps.googleapis.com/maps/api/place/search/json?radius=50&sensor=true&key=<my key>&location=22,75
https://maps.googleapis.com/maps/api/place/search/json?radius=50&sensor=true&key=&location=22,75

按照以下链接注册google地图密钥

并确保已从api和auth启用api

此外,在提供sha1密钥和应用程序包名称的同时,请提供有效数据

希望能有所帮助

要确保为有效密钥启用有效API

注意: 为浏览器api服务器启用放置api-浏览器密钥。 放置android密钥的api-android密钥“状态”:“请求被拒绝”-表示有关启用Google api权限的问题。 请确保您没有忘记启用API:

谷歌地图Android API
谷歌地图地理编码API
谷歌地图地理定位API
谷歌为Android发布API
googleplacesapiweb服务

我也面临同样的问题,但在浏览开发者网站后我发现;它还需要为Web服务启用PlacesAPI,这对我来说很有用

希望这可能会有帮助

“状态”:“请求被拒绝”
表示有关启用Google API权限的问题。请确保您没有忘记启用API:

  • 谷歌地图Android API
  • 谷歌地图地理编码API
  • 谷歌地图地理定位API
  • 谷歌为Android发布API
  • googleplacesapiweb服务

确保(在您的Google API控制台上,)启用了“Google Places API Web Service”。您必须使用服务器密钥(不是Android密钥)


可能重复:@DanielNugent仍然有相同的错误您在开发人员控制台中启用了
Google Places API Web Service
了吗?您的链接现在对我有效,所以我想您的问题已经解决了。将来,永远不要发布API密钥。是的,它现在对我也有效thanx@DanielNugent你帮了我很多忙,我欠你的,只是要注意,这个问题中的API需要一个服务器密钥,不需要指定sha1值或包名。@user3508256是的,我自己也用过浏览器密钥,它工作得很好!尽管文档中说只能与服务器密钥一起使用。