谷歌PlacePicker立即关闭与结果code 2推出后 [英] Google PlacePicker Closes Immediately After Launch with resultCode 2
问题描述
在我的项目 PlacePicker
工作正常,但今天突然关闭其使用结果code发射后立即2。
In my project PlacePicker
was working fine but today suddenly its closing immediately after launch with resultCode 2.
这里是logcat的输出
here is the logcat output
07-06 16:06:36.596 1023-20519/? W/Places﹕ e.a:638: gLocReplyElement
unsuccessful status: 1
07-06 16:06:36.596 1023-20519/? W/Places﹕ e.a:665: gPlaceQueryResult
unsuccessful responseCode: 26
07-06 16:06:36.596 21086-21708/? E/PlacePicker﹕
PLACES_API_QUOTA_FAILED
你知道吗?是什么 PLACES_API_QUOTA_FAILED
错误code的含义是什么?
Any idea? what is the meaning of PLACES_API_QUOTA_FAILED
error code?
推荐答案
假设你有地方API启用了Android和你的API密钥在您的清单中正确配置,这也可能发生,如果你缺少你SHA-1证书指纹(S)在开发者控制台。因此,请确保您有以下包括:
Assuming you have the Place API for Android enabled and your API key is correctly configured in your manifest, this could also happen if you are missing your SHA-1 certificate fingerprint(s) in your developer console. So, make sure you have the following covered:
-
在开发者控制台,确保你有你的Android应用程序生成的API密钥,并确保API密钥在您的清单文件输入。它应该是嵌套在应用标签内的元标记。
In the developers console make sure you have the API key generated for your android app and make sure the API key is entered in your manifest file. It should be a meta tag nested inside the application tag.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.my.awesome.app">
<application>
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="AIza..."/>
... other stuff
</application>
</manifest>
要生成调试模式下keyhash:
To generate the keyhash for the debug mode:
keytool -exportcert -alias androiddebugkey -keystore C:\Users\{username}\.android\debug.keystore -list -v
同样的命令用于发行版,但这个时候你需要指向你自己的密钥库。
Same command is used for the release version, but this time you'd need to point to your own keystore.
More info here
这篇关于谷歌PlacePicker立即关闭与结果code 2推出后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!