Android Google服务:用于发布和调试的API密钥和SHA-1指纹 [英] Android Google Services: API key and SHA-1 fingerprint for release and debug

查看:192
本文介绍了Android Google服务:用于发布和调试的API密钥和SHA-1指纹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我能够在android studio中成功构建release-apk.

I was able to build a release-apk successfully in android studios.

我的应用使用Google的某些服务,例如Google App邀请和Android的Google地方.

My app uses some services from Google like Google App Invites and Google Places for Android.

要获得这些服务,我必须在Google开发者控制台上注册一个如下所示的API密钥:

To get these services, I had to register a API key on the google developers console which looks like this:

我不确定要获取API密钥的软件包名称和SHA-1指纹部分.

I'm unsure about the package name and SHA-1 fingerprint section of getting an API key.

如果我同时拥有我的应用程序的调试版本和发行版(例如,程序包名称为com.myapp),我是否将com.myapp作为程序包名称两次输入,但设置了发行版并调试SHA-1每个包的名称分别是什么?

If I have both a debug and a release version of my app (let's say the package name is com.myapp), do I put in the com.myapp as the package name twice but set the release and debug SHA-1 respectively for each package name?

所以:

com.myapp (SHA-1 fingerprint) S1:2D:3F etc
com.myapp (SHA-1 fingerprint) D2:1W:2V etc

我试图这样做,但是到目前为止,该应用的发行版似乎根本不起作用.

I tried to do that but so far the release version of the app does not seem to want to work at all.

APP_INVITE说:

APP_INVITE says:

未找到包名称com.myapp的Android客户端ID. (APPINVITE_CLIENT_ID_ERROR)

No Android client ID is found for package name com.myapp. (APPINVITE_CLIENT_ID_ERROR)

地点自动完成说:

获取自动完成预测API调用时出错: 状态{statusCode = PLACES_API_INVALID_APP,分辨率=空}

Error getting autocomplete prediction API call: Status{statusCode=PLACES_API_INVALID_APP, resolution=null}

推荐答案

好-经过一些调查,是的,您确实输入了两次软件包名称,然后分别为发行版和调试版输入了SHA-1指纹.这将使PLACES正常工作.

OK - after some investigations, yes, you do put your package name twice and then you put the SHA-1 fingerprint for the release and debug version separately. This will make PLACES work.

此外,从我的调查中,我注意到APP_INVITE错误指出找不到该软件包的客户端ID.请注意,这是指您的OAuth 2.0客户端ID,该ID可在Google Developer Console的API密钥下找到.更改该SHA-1密钥(在这种情况下,不能选择放入开发SHA-1和脱预算SHA-1)将导致APP_INVITE工作.

Also, from my investigations, I noticed that the APP_INVITE error pointed to no client ID found for the package. Please note that this is referring to your OAuth 2.0 client IDs which can be found under your API keys in your Google Developer Console. Changing that SHA-1 key (there is no option to put in a development SHA-1 and a debud SHA-1in this case) will result in APP_INVITE working.

这篇关于Android Google服务:用于发布和调试的API密钥和SHA-1指纹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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