简体   繁体   中英

Android Google Sign-In fails on App Bundles

I am trying to use app bundles for my app. I have enrolled into App Signing by Google and went over all the steps. While I was testing the build generated from App Bundles, I see Google Sign-In feature fails and there are no error logs to help me debug. Everything works fine on .apk. Has anyone else encountered this while using app bundles?

You must be using the 'auto' option for resConfig. 'auto' has been deprecated from the standard build, and is not supported in the bundle (the warning probably got lost in the logs after the error popped up):

android { defaultConfig { ... resConfigs "auto" } }

Non-'auto' resConfigs are still supported in the bundle, so just specify which languages you would like to keep, as described in the documentation:

android { defaultConfig { ... resConfigs "en", "fr" } }

When you configure Google Sign-In, you need to go to the Google API Console and set the credentials of your Android application, which includes a SHA1 of the certificate of your application.

Instead of putting the SHA1 of the certificate that you upload your APK (or App Bundle) with, you should put the SHA1 of the App Signing certificate (ie what is served through the Play Store). You can find this information in the App Integrity page in the Play Console:

应用签名截图

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