Google Place Api:来自此Android客户端应用程序com.package.name的请求被阻止 [英] Google Place Api: Requests from this Android client application com.package.name are blocked

查看:51
本文介绍了Google Place Api:来自此Android客户端应用程序com.package.name的请求被阻止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 PlaceAutocompleteFragment ,当我单击搜索字段PlaceAutocompleteFragment对话框消失时,我得到此错误:

I am using PlaceAutocompleteFragment and when i click on search field PlaceAutocompleteFragment dialog disappear then i get this error :

{错误":[{域":全局",原因":禁止",消息":此Android客户端应用程序com.ganger.package的请求被阻止."}],代码":403}

{"errors":[{"domain":"global","reason":"forbidden","message":"Requests from this Android client application com.ganger.package are blocked."}],"code":403}

顺便说一句,当我通过Android Studio安装应用程序时,它的工作原理非常完美,因此...我为解决这个问题所做的工作

by the way, when I install the application through the Android Studio this works perfectly so... what I have done for solve this

1.生成了新的API,但是没有用.

1.generated new API but it didn't work.

2.google place API已启用.

2.google place API is enabled.

4.meta数据位于清单文件中的应用程序标记中.

4.meta data is in application tag in the manifest file.

5. Android Place自动填充片段自行关闭

6.地方自动填充功能无法在Android上正常运行7. PlaceAutocompleteFragment点击消失..做完所有这些事情之后仍然面临着同样的问题.在此先感谢您,对于英语不好,我们深表歉意.

6.Place Autocomplete not working properly Android 7.PlaceAutocompleteFragment disappears on click. After doing all these things still facing the same problem. Thanks in advance and really sorry for bad English...

推荐答案

似乎由于错误的SHA1 Fingerptint而导致出现错误,因为您必须基于应用程序的数字证书添加SHA1.

It seems like you are getting the error due to wrong SHA1 fingerptint because you have to add SHA1 based on your app's digital certificate.

在您的问题中,您提到当您以调试配置(直接从Android Studio)运行应用程序时,该应用程序运行良好.因此,我认为它工作正常,因为您已经为调试证书输入了SHA1.因此,当您在发布配置(带有密钥库的已签名apk)中运行应用程序时,还必须添加SHA1来进行发布配置,以使用API​​.

In Your question you mentioned that the app is working fine when you run the app in debug-configuration(directly from the Android Studio). So i think it's working fine because you have entered the SHA1 for your debug-certificate. So you have to add the SHA1 for your release configuration as well to work with the API while you run the app in release-configuration(Signed apk with key-store).

您可以从 查看全文

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆