Google 从 Playstore 下载的应用无法登录
Google Sign in not working from app downloaded from playstore
- 创建了一个应用程序,该应用程序使用 react-native-google-signin 通过 google 登录
登录应用程序
- 如所述here
创建了一个用于签署我的应用程序的密钥库
- 签署我的应用程序并上传到 Google Playstore
- 当我被问及是否要选择加入
Google Play App Signing
时,我同意了
- 如果我尝试登录我的应用程序(从 Playstore 下载),我收到错误
messsage: DEVELOPER_ERROR
、error code: 10
Note1: my app does not use firebase
Note2: if I install the apk directly into my device, the login seems to work
我确定问题与使用 Google Play App Signing 对应用程序进行签名的方式有关,但我无法隔离问题
更新:
- 从 here 下载
google-services.json
并将其添加到 /android/app
下,如果我从发布管理页面下载它并手动安装,现在该应用程序可以正常工作。如果我直接从 Google Play 商店安装它仍然不起作用。
您在调试模式下为您的应用添加了 sha-1 密钥,届时您将能够 google 登录您的应用。
但是随着应用程序投入生产,它需要用于生产的 sha-1 密钥。
并且您需要在 firebase 控制台添加。
您可以检查您的 firebase 控制台并检查 android app.
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
以上命令有助于为调试版本创建 sha-1 密钥。
您需要为生产 sha-1 提供签名的密钥库文件路径。
这将通过命令
完成
keytool -exportcert -list -v \-alias <your-key-name> -keystore <path-to-production-keystore>
您只需要为发布的 apk 提供密钥库文件的具体路径。
解决方案:
- 问题是在生成
google-services.json
时,需要提供 App signing certificate
SHA-1 certificate fingerprint
;我提供了 Upload certificate
的 SHA-1 certificate fingerprint
,这就是为什么它不能用于生产。
- 本质上,在 credentials page 中,您需要为 Android 创建两个 oauth 客户端 ID(一个带有
App Signing certificate
,一个带有 Upload certificate
和一个 web
类型的 oauth 客户端 ID,在使用 react-native-google-signin
时,您需要指定 webClientId
。
昨天我遇到了同样的问题。
Google 在 Playstore 发布控制台中发布了一项新的签名服务,其中 google 将使用他的密钥库登录您的应用程序。签名后,它会给你一个新的 SHA,你必须将它添加到你的 fireenter image description herebase 帐户中。查看图片以更好地理解
这很简单,转到您上传签名 APK 的播放商店帐户。 select 您的应用程序,然后转到 发布管理部分 然后 应用程序签名 。
复制应用签名证书的 SHA1 密钥。
转到此 link https://developers.google.com/identity/sign-in/android/start-integrating
单击配置项目按钮
select你的App,selectAndroid,app你的应用包名,然后粘贴SHA1证书
然后点击创建。就是这样。
现在您可以在您的应用程序中使用google登录
- 创建了一个应用程序,该应用程序使用 react-native-google-signin 通过 google 登录 登录应用程序
- 如所述here 创建了一个用于签署我的应用程序的密钥库
- 签署我的应用程序并上传到 Google Playstore
- 当我被问及是否要选择加入
Google Play App Signing
时,我同意了
- 当我被问及是否要选择加入
- 如果我尝试登录我的应用程序(从 Playstore 下载),我收到错误
messsage: DEVELOPER_ERROR
、error code: 10
Note1: my app does not use firebase
Note2: if I install the apk directly into my device, the login seems to work
我确定问题与使用 Google Play App Signing 对应用程序进行签名的方式有关,但我无法隔离问题
更新:
- 从 here 下载
google-services.json
并将其添加到/android/app
下,如果我从发布管理页面下载它并手动安装,现在该应用程序可以正常工作。如果我直接从 Google Play 商店安装它仍然不起作用。
您在调试模式下为您的应用添加了 sha-1 密钥,届时您将能够 google 登录您的应用。 但是随着应用程序投入生产,它需要用于生产的 sha-1 密钥。 并且您需要在 firebase 控制台添加。 您可以检查您的 firebase 控制台并检查 android app.
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
以上命令有助于为调试版本创建 sha-1 密钥。
您需要为生产 sha-1 提供签名的密钥库文件路径。 这将通过命令
完成keytool -exportcert -list -v \-alias <your-key-name> -keystore <path-to-production-keystore>
您只需要为发布的 apk 提供密钥库文件的具体路径。
解决方案:
- 问题是在生成
google-services.json
时,需要提供App signing certificate
SHA-1 certificate fingerprint
;我提供了Upload certificate
的SHA-1 certificate fingerprint
,这就是为什么它不能用于生产。 - 本质上,在 credentials page 中,您需要为 Android 创建两个 oauth 客户端 ID(一个带有
App Signing certificate
,一个带有Upload certificate
和一个web
类型的 oauth 客户端 ID,在使用react-native-google-signin
时,您需要指定webClientId
。
昨天我遇到了同样的问题。
Google 在 Playstore 发布控制台中发布了一项新的签名服务,其中 google 将使用他的密钥库登录您的应用程序。签名后,它会给你一个新的 SHA,你必须将它添加到你的 fireenter image description herebase 帐户中。查看图片以更好地理解
这很简单,转到您上传签名 APK 的播放商店帐户。 select 您的应用程序,然后转到 发布管理部分 然后 应用程序签名 。
复制应用签名证书的 SHA1 密钥。
转到此 link https://developers.google.com/identity/sign-in/android/start-integrating
单击配置项目按钮
select你的App,selectAndroid,app你的应用包名,然后粘贴SHA1证书
然后点击创建。就是这样。
现在您可以在您的应用程序中使用google登录