gpt4 book ai didi

android - Google 登录无法正常工作

转载 作者:塔克拉玛干 更新时间:2023-11-01 21:44:58 27 4
gpt4 key购买 nike

我已经在我的 android 应用程序中集成了 sign in with google,现在的问题是在某些设备上它无法正常工作,但在我的模拟器和某些设备上它工作正常,这是什么问题?

https://developers.google.com/identity/sign-in/android/

http://www.androidhive.info/2014/02/android-login-with-google-plus-account-1/

这两个教程用于登录,但是当我运行我的应用程序并尝试登录时它允许选择帐户,但是当我在我的 logcat 中单击它时它显示

System.out: Google logout

代码

private void handleSignInResult(GoogleSignInResult result) {
Log.d("", "handleSignInResult:" + result.isSuccess());
if (result.isSuccess()) {
// Signed in successfully, show authenticated UI.
GoogleSignInAccount acct = result.getSignInAccount();

Log.e("", "display name: " + acct.getDisplayName());


personName = acct.getDisplayName();
personPhotoUrl = String.valueOf(acct.getPhotoUrl());
ggoleemail = acct.getEmail();
googleid = "G" + acct.getId();
// String baday = String.valueOf(acct.getAccount());

Log.e(TAG, "Name: " + personName + googleid + ", email: " + ggoleemail
+ ", Image: " + personPhotoUrl);
/* txtName.setText(personName);
txtEmail.setText(email);
Glide.with(getApplicationContext()).load(personPhotoUrl)
.thumbnail(0.5f)
.crossFade()
.diskCacheStrategy(DiskCacheStrategy.ALL)
.into(imgProfilePic);
*/
googleslogins();
// updateUI(true);

} else {
// Signed out, show unauthenticated UI.
//updateUI(false);
System.out.println("Google logout");
}
}

最佳答案

您是否在 Google 开发者控制台上添加了证书的哈希值并在 Google API 管理器中启用了 API?

API - GooglePlus 和 People API

关于android - Google 登录无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43657187/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com