简体   繁体   English

在 Google Play 中使用 app Bundle 时,GoogleSignInAccount 返回 null

[英]GoogleSignInAccount return null when use app Bundle in Google play

I want to use Google login in my application When I get the APK output, there is no problem and the program works easily But when I load the program with the bundle output on the Google console, after installing and logging in and selecting the Google account, it returns a null output.我想在我的应用程序中使用谷歌登录当我得到 APK output 时,没有问题,程序很容易运行但是当我在谷歌控制台上使用捆绑包 output 加载程序时,安装并登录并选择谷歌帐户后,它返回一个 null output。 I did not use Proguard either我也没有使用 Proguard

GoogleSignInOptions gso =
            new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
                    .requestIdToken(Setting.GetGoogleClientId())
                    .requestEmail()
                    .build();

After choosing the email, this value becomes null:选择email后,这个值变成null:

@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
  
     super.onActivityResult(requestCode, resultCode, data);
    

    if (requestCode == CALL_GOOGLE)
    {
        Task<GoogleSignInAccount> task = GoogleSignIn.getSignedInAccountFromIntent(data);
       
        GoogleSignInAccount account = task.getResult(ApiException.class);
        // account or account.getEmail() is null
        
    }
}

Get sha1 code from Google Play Console and fix!从 Google Play 控制台获取 sha1 代码并修复!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Google+已弃用和GoogleSignInAccount getPhotoUrl()返回null - Google+ DEPRECATED and GoogleSignInAccount getPhotoUrl() return null GoogleSignInAccount getPhotoUrl()返回null - GoogleSignInAccount getPhotoUrl() return null (Unity) 使用 BuildPipeline 构建时启用 App Bundle (Google Play) 选项? - (Unity) Enabling App Bundle (Google Play) option when building with the BuildPipeline? Google Play 在发布应用程序包时显示无效警告 - Google play shows invalid warning when releasing app bundle 如何将 android 应用程序包上传到 Google Play - how to upload an android app bundle to google play 无法在 Google Play 上上传 App Bundle - Cannot upload an App Bundle on Google Play 将 App Bundle 上传到 Google Play 时卡在处理中 - Uploading App Bundle to Google Play stuck in processing 无法在 Google Play 上上传 Android App Bundle - can not upload Android App Bundle on Google Play 从Google Play商店下载应用时,getInstallerPackageName()是否可能为null? - Is it possible that getInstallerPackageName() is null when app downloaded from Google Play Store? Google Play 控制台 Play 应用签名 - Android App Bundle 未签名 - Google Play Console Play App Signing - The Android App Bundle was not signed
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM