IamworkingonanAndroidappthatusesGoogleSign-In.我正在开发一款使用Google登录的Android应用。Everythingwa
I am working on an Android app that uses Google Sign-In.
我正在开发一款使用Google登录的Android应用。
Everything was working fine until recently. I stopped working on this project for about two weeks and got back to it yesterday, and the Google Sign-In is suddenly not working anymore. When I click sign in, the Sign-In popup opens, I choose my account and... nothing happens.
一切都很好,直到最近。我在这个项目上停止工作了大约两个星期,并且昨天又回到了它,谷歌登录突然不再起作用了。当我点击登录时,登录弹出窗口打开,我选择了我的帐户......没有任何反应。
So as I did not change anything in the code related to the Sign-In, I started to search everywhere else.
因为我没有更改与登录相关的代码中的任何内容,所以我开始在其他地方搜索。
First I noticed that my compile 'com.google.android.gms:play-services-auth:11.4.2'
could be updated to 11.6.0, so this is what I did.
首先我注意到我的编译'com.google.android.gms:play-services-auth:11.4.2'可以更新到11.6.0,所以这就是我所做的。
I ran the app again and it was now asking me to update Google Play Services, so I clicked on update button but again, nothing happened. I tried multiple times but it didn't change anything. So I started looking somewhere else.
我再次运行应用程序,它现在要求我更新Google Play服务,所以我点击了更新按钮但是再一次没有发生任何事情。我尝试了多次,但没有改变任何东西。所以我开始寻找其他地方。
I went to the link where I found the code sample for Google Sign-In to see if anything has changed and... yea it has changed, 10 days ago the sample was updated so I updated my code and now, nothing better, just that the Sign-In popup does not appear now when I click sign in.
我去了链接,在那里我找到了Google登录的代码示例,看看是否有任何变化......是的,它已经改变了,10天前样本已经更新,所以我更新了我的代码,现在,没有更好,只是单击登录时,现在不显示登录弹出窗口。
So I started looking more deeply at the logs, and here are the problematic lines : W/GooglePlayServicesUtil: Google Play services out of date. Requires 11717000 but found 11577470 W/FA: Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null} W/LoginActivity: signInResult:failed code=12500
所以我开始更深入地研究日志,这里有一些问题:W / GooglePlayServicesUtil:Google Play服务已经过时了。需要11717000但找到11577470 W / FA:服务连接失败:ConnectionResult {statusCode = SERVICE_VERSION_UPDATE_REQUIRED,resolution = null,message = null} W / LoginActivity:signInResult:failed code = 12500
So apparently, it should be related to Google Play Services... Note that I don't get the "Update Google Play Services" popup anymore. Most of the answers that I found regarding this kind of issue suggested to try on another emulator with a lower API, or downgrading Google Play Services compile line, so I tried both. I used to run my tests on a Pixel XL with API 27, I tried on a Nexus 6P with API 25, on this one I can get to the Sign-In popup but when selecting my account I get W/LoginActivity: signInResult:failed code=10.
I also tried on two real devices that are OnePlus 3 with API 25 and Samsung Galaxy S6 Edge with API 24, I get the same error on these two than on Nexus 6P. Moreover I don't find anything regarding the meaning of the error code 10. Regarding Google Play Services downgrade, some classes of the new code sample are not recognized if I do so. Also, it seems not to be a Google Play Services issue anymore when trying on devices with lower API than 27.
显然,它应该与Google Play服务有关...请注意,我不再获得“更新Google Play服务”弹出窗口。我发现有关此类问题的大多数答案建议尝试使用较低API的其他模拟器,或降级Google Play服务编译行,因此我尝试了两者。我曾经在带有API 27的Pixel XL上运行我的测试,我尝试使用带有API 25的Nexus 6P,在这个上我可以进入登录弹出窗口但是在选择我的帐户时我得到W / LoginActivity:signInResult:failed代码= 10。我还尝试了两个真正的设备,即带有API 25的OnePlus 3和带有API 24的三星Galaxy S6 Edge,我在这两个设备上得到的错误与Nexus 6P相同。此外,我没有找到任何关于错误代码10含义的内容。关于Google Play服务降级,如果我这样做,则无法识别新代码示例的某些类。此外,在尝试API低于27的设备时,似乎不再是Google Play服务问题。
UPDATE : I found that the error code 10 means "The application is misconfigured". I don't see how since nothing has changed between the time everything worked find and the time it stopped working, anyway I generated a new debug.keystore, a new configuration file and added it to my /app. And obviously it still does not work.
更新:我发现错误代码10表示“应用程序配置错误”。我没有看到,因为在找到所有工作的时间和它停止工作的时间之间没有任何变化,无论如何我生成了一个新的debug.keystore,一个新的配置文件并将其添加到我的/ app。显然它仍然不起作用。
UPDATE 2 : As I tried everything thinkable, and I knew something was wrong with my debug.keystore (I read everywhere that this file should regenerate itself if deleted when building a project, which was not the case for me). I uninstalled/reinstalled Android Studio, hoping that it will at least solve this problem. Well I had tons of files that I don't remember in .android folder and now I have only 1 folder and 2 files, obviously debug.keystore is not one of them. So this made me remember that there is another way of getting the SHA1 signature and this is what I explain in my answer post. But still there is something wrong with my debug.keystore so if anyone has an idea...
更新2:当我尝试所有可想到的东西时,我知道我的debug.keystore出了问题(我在任何地方都读到如果在构建项目时删除了这个文件应该重新生成,这对我来说并非如此)。我卸载/重新安装了Android Studio,希望它至少能解决这个问题。好吧,我有很多文件,我不记得.android文件夹,现在我只有1个文件夹和2个文件,显然debug.keystore不是其中之一。所以这让我记住了获得SHA1签名的另一种方式,这就是我在回答帖子中解释的内容。但是我的debug.keystore仍然有问题,所以如果有人有想法......
1 个解决方案