Google Sign in Error

jhmgbl

Newbie
Registriert
Nov. 2018
Beiträge
1
Ich bekomme diesen Fehler nachdem ich einen Google Account ausgewählt habe. OnActivityResult wird aufgerufen, aber nachdem ich GoogleSignInAccount account = completedTask.getResult(ApiException.class) aufgerufen habe, wird ein Fehler verursacht.
Der Ursache ist kein falscher SHA1. Ich benutze denselben key für release und debug. Die app ist nicht von Google Play. Ich benutze nicht firebase. Das Google sample signin Programm funktioniert mit diesem key. Die app hat einen Vordergrunddienst.

com.google.android.gms.common.api.ApiException: 12500:

Stacktrace:

W/System.err: com.google.android.gms.common.api.ApiException: 12500:
W/System.err: at com.google.android.gms.common.internal.ApiExceptionUtil.fromStatus(Unknown Source)
W/System.err: at com.google.android.gms.auth.api.signin.GoogleSignIn.getSignedInAccountFromIntent(Unknown Source)
W/System.err: at de.org.limindo.limindo2.fragLogin.onActivityResult(fragLogin.java:412)
W/System.err: at android.support.v4.app.FragmentActivity.onActivityResult(FragmentActivity.java:151)
W/System.err: at de.org.limindo.limindo2.MainActivity.onActivityResult(MainActivity.java:788)
W/System.err: at android.app.Activity.dispatchActivityResult(Activity.java:5456)
W/System.err: at android.app.ActivityThread.deliverResults(ActivityThread.java:3549)
W/System.err: at android.app.ActivityThread.handleSendResult(ActivityThread.java:3596)
W/System.err: at android.app.ActivityThread.access$1300(ActivityThread.java:151)
W/System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1369)
W/System.err: at android.os.Handler.dispatchMessage(Handler.java:110)
W/System.err: at android.os.Looper.loop(Looper.java:193)
W/System.err: at android.app.ActivityThread.main(ActivityThread.java:5299)
W/System.err: at java.lang.reflect.Method.invokeNative(Native Method)
W/System.err: at java.lang.reflect.Method.invoke(Method.java:515)
W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:825)
W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:641)
W/System.err: at dalvik.system.NativeStart.main(Native Method)

Java:
               GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
                    .requestEmail()
                    .build();
            mGoogleSignInClient = GoogleSignIn.getClient(fragLogin.this._main, gso);
 

    mSignInGoogle0.setOnClickListener(new OnClickListener()
            {
                @Override
                public void onClick(View view)
                {
                    Intent signInIntent = mGoogleSignInClient.getSignInIntent();
                    startActivityForResult(signInIntent, RC_SIGN_IN);

                }
            });

    @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 == RC_SIGN_IN) {
            // 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.
            if (account != null)
            {
                mPasswordView.setVisibility(View.GONE);
                mPasswordView.setVisibility(View.GONE);
            }
            updateUI(account);
        } catch (ApiException e) {
            e.printStackTrace();
            // The ApiException status code indicates the detailed failure reason.
            // Please refer to the GoogleSignInStatusCodes class reference for more information.
            Log.w(TAG, "signInResult:failed code=" + e.getStatusCode());
            lib.ShowMessage(getContext(), getString(R.string.googleloginnotsuccessfull) + "\n" + getString(R.string.ErrorCode) + GoogleSignInStatusCodes.getStatusCodeString(e.getStatusCode()) + ":" + e.getStatusCode(), getString(R.string.Error));
            updateUI(null);
        }
    }
 
Zurück
Oben