Android 试图使用谷歌播放服务,谷歌登录,不断得到一个错误代码10

Android 试图使用谷歌播放服务,谷歌登录,不断得到一个错误代码10,android,google-play-services,google-signin,Android,Google Play Services,Google Signin,我正在尝试实现如下所述的google登录功能: 在oncreate中,我有以下内容: // Configure sign-in to request the user's ID, email address, and basic // profile. ID and basic profile are included in DEFAULT_SIGN_IN. GoogleSignInOptions gso = new GoogleSignInOptions.Builde

我正在尝试实现如下所述的google登录功能:

在oncreate中,我有以下内容:

    // Configure sign-in to request the user's ID, email address, and basic
    // profile. ID and basic profile are included in DEFAULT_SIGN_IN.
    GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
            .requestEmail()
            .build();

    // Build a GoogleSignInClient with the options specified by gso.
    mGoogleSignInClient = GoogleSignIn.getClient(this, gso);
我在活动中也有以下功能

public void signIn(View v) {
    System.out.println("WHAT!");
    Intent signInIntent = mGoogleSignInClient.getSignInIntent();
    startActivityForResult(signInIntent, 100);
 }
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    // Result returned from launching the Intent from GoogleSignInClient.getSignInIntent(...);
    if (requestCode == 100) {
        // The Task returned from this call is always completed, no need to attach
        // a listener.
        Task<GoogleSignInAccount> task = GoogleSignIn.getSignedInAccountFromIntent(data);
        handleSignInResult(task);
    }
}

private void handleSignInResult(Task<GoogleSignInAccount> completedTask) {
    try {
        GoogleSignInAccount account = completedTask.getResult(ApiException.class);

        // Signed in successfully, show authenticated UI.
        System.out.println("Success "+account);
      //  updateUI(account);
    } catch (ApiException e) {
        // The ApiException status code indicates the detailed failure reason.
        // Please refer to the GoogleSignInStatusCodes class reference for more information.
        System.out.println( "signInResult:failed code=" + e.getStatusCode());
        System.out.println( "ERROR "+e.getMessage());
       // updateUI(null);
    }
}

嗯,基本上我没有在谷歌api级别配置应用程序来接受谷歌登录


我对此并不感到惊讶,但是如果上面的链接从他们的文档中引用了这个需求,那就太好了。一旦我正确地完成了这项工作并集成了ID和密钥,一切都会按预期进行。

谷歌游戏。 В итоге проблема была решена.
在本研究中,除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了除了之外之外之外之外之外之外之外之外之外之外之外之外之外之外之外之外之外之外之外之外之外之外之外之外之外之外之外之外之外之外之外之外之外之外之外之外之外之外之外之外之外之外之外之外之外之外之外之外之外之外之外之外之外之外之外之外бб”。“OAuth客户端”几乎是用户使用的英语,所以请编辑您的答案并用英语书写
compile 'com.google.android.gms:play-services-auth:11.6.0'