昨天遇到一个奇葩问题,记录一下:

GooglePlay上面之前有一款应用A,由于某种原因被下架了,于是需要修改包名和签名后重新上架成应用B

登录操作是FireBase下的Google登录,A和B都进行了配置。

B的Firebase账号和GooglePlay开发者账号不是同一个

当B成功上架后,发现Google不能登录了,what ???测试好好的,怎么从GooglePlay下载就不能登录了。起初以为是GooglePlay的签名机制导致的,后来发现和它没关系

详细错误信息如下:

failurecom.google.firebase.auth.FirebaseAuthInvalidCredentialsException: The supplied auth credential is malformed or has expired. [ Invalid Idp Response: the Google id_token is not allowed to be used with this application. Its audience (OAuth 2.0 client ID) is AAAAAA3kfg3trfusn6unj8efo.apps.googleusercontent.com, which is not authorized to be used in the project with project_number: 1326579. ]

其中:AAAAAA3kfg3trfusn6unj8efo.apps.googleusercontent.com是B新项目的Web Client id

1326579是旧项目的Project_number

看到此错误后,百思不得其解。于是先删除A项目的FireBase相关。

再试,又出现另外的错误:大致意思是Api Key不可用。

于是又连忙恢复FireBase的A项目。

折腾了一天,最后突然想到FireBase可以配置外部的WebClient

Firebase下的google登录问题,FirebaseAuthInvalidCredentialsException: which is not authorized to be used in_Google

结果真的可以了,登录成功了。。。

记录下,防止以后遇到