与谷歌Android登录不工作在释放apk [英] Sign-in with google for android not working in release apk
问题描述
我已将Google Sign登录到我的应用程序中,并按照官方文档中的所有步骤进行工作。
一切正常,直到我生成一个签名apk发布。该应用程序无法登录,
I have added the Google Sign in in my application and made it work by following all the steps in the official documentation. Everything worked fine, until I generated a signed apk for publishing. The app could not sign in , the
Log.d(TAG,handleSignInResult:+ result.isSuccess()); p>
Log.d(TAG, "handleSignInResult:" + result.isSuccess());
在SignInActivity.java的 handleSignInResult()
中给出的值为 false
。
in SignInActivity.java's handleSignInResult()
gives the value as false
.
我已经在开发人员控制台上注册了应用程序,并提供了SHA1密钥来调试密钥以及释放密钥。我无法解决这个问题,也找不到文件中的任何相关内容。
I have registered the app on the developer console and provided the SHA1 key for they debug key as well as the release key. I am unable to solve this and couldn't find anything related in the documentation either.
推荐答案
终于解决了它。我在注册项目下的Google Developers Console中为我的释放键( .jks
文件)添加了SHA1键。
在Android Studio中,在左侧,项目视图下有一个生成变体的选项。在那里,我将每个模块更改为 release
模式(缺省情况下,它位于 debug
模式下)。然后通过常规方法创建签名APK,然后运行该应用程序。 Google Signin完美运作。
Finally solved it. I added the SHA1 key for my release key (the .jks
file) in the Google Developers Console under the project registered.
In Android Studio, at the left side, there is an option for Build variants under the project view. There, I changed each module to release
mode (it is in debug
mode by default). Then created the Signed APK by usual method, and run the app. The Google Signin worked perfectly.
这篇关于与谷歌Android登录不工作在释放apk的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!