简体   繁体   中英

Google SignIn doesn't work after release APK ( before worked )

I have problems with standard Google SignIn: after build a release of my android application Google SignIn doesn't work. I followed the guide as explained here to build a release: https://developer.android.com/studio/publish/app-signing.html

Then, I go to google API console and I create a new client OAuth 2.0 using private key: SHA1 is generated with

keytool -exportcert -keystore MY_PATH_TO_PRIVATE_KEY -list -v

Password of my keystore is requested and then I see SHA1. I think this procedure is the right one, because I used the same for Facebook Login and it works. I'm using the latest version of Android Studio.

Have I to add some in Gradle Config or in Android Manifest?

找到SHA-1密钥的步骤:1)转到您的Google Play控制台2)选择目标应用程序3)转到“版本管理”下的“应用程序签名” 4)在“应用程序签名”下可以找到SHA-1密钥证书” 5)更新您的证书页面中的密钥

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM