我一直在遵循this在我的应用程序中实现谷歌登录。我遵循了每一步,在firebase和应用程序中设置了我的SHA1和web cliednt id。
发生了什么:我点击按钮登录谷歌,出现谷歌提示,我选择propmt关闭的帐户。
我在这里和那里放了一些祝酒词,看看代码在哪里被卡住了
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
// Result returned
from launching the Intent from GoogleSignInApi.getSignInIntent(...);
if (requestCode == GOOGLE_SIGN) {
Task<GoogleSignInAccount> task = GoogleSignIn.getSignedInAccountFromIntent(data);
try {
// Google Sign In was successful, authenticate with Firebase
GoogleSignInAccount account = task.getResult(ApiException.class);
firebaseAuthWithGoogle(account);
} catch (ApiException e) {
alert("You suck even more"); <---THIS ONE
// Google Sign In failed, update UI appropriately
// ...
}
}
}将显示捕获器中的吐司(ApiException e)。为什么它会卡在onActivityResult上?
下面是gradle:
dependencies {
implementation 'com.google.firebase:firebase-core:17.0.0'
implementation 'com.google.firebase:firebase-auth:17.0.0'
implementation 'com.google.firebase:firebase-storage:17.0.0'
implementation 'com.firebaseui:firebase-ui-storage:4.1.0'
implementation 'com.firebaseui:firebase-ui-database:4.1.0'
implementation 'com.google.android.gms:play-services-auth:15.0.1'
}
apply plugin: 'com.google.gms.google-services'或者至少是与谷歌相关的。
我已经关注了关于这个aPI异常的所有内容,但是没有任何帮助。见鬼,我甚至因为沮丧而删除了整个Firebase项目,并重新创建了它,并做了this……但是什么都没有..。我甚至不能这样做,因为我不能在Google Dev和Firebase中放入相同的SHA1,我会得到一个d uplicate的提示请,这肯定比这简单得多,我想我现在只是想多了
请帮帮我,我花了5个小时才看完github的问题。
发布于 2019-07-10 02:42:01
您是否添加了支持电子邮件地址。因为这是我们在设置firebase时常用的方法。如果没有支持电子邮件地址,我们可以从firebase获得所需的结果

https://stackoverflow.com/questions/56958656
复制相似问题