谷歌PlacePicker立即关闭与结果code 2推出后 [英] Google PlacePicker Closes Immediately After Launch with resultCode 2

查看:470
本文介绍了谷歌PlacePicker立即关闭与结果code 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:


  1. 在开发者控制台,确保你有你的Andr​​oid应用程序生成的API密钥,并确保API密钥在您的清单文件输入。它应该是嵌套在应用标签内的元标记。

  1. 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>


  • 在同一页作为您的API密钥,在底部,你需要从你的清单和证书输入包名称。而在开发/调试模式下可以使用由工作室提供的调试密钥库证书,但是,对于发行版本你就必须产生自己的密钥库。

  • 要生成调试模式下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屋!

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