JavaEar 专注于收集分享传播有价值的技术资料

GooglePlus oauth an internal error has occured

I know there is a million posts about this and i have read them all. I keep getting an internal error has occured when i try to sign in. I have tried multiple android-support-v4 and google-play-services jar files. I have tried including google play services as a library.

The only warning i am getting is this

03-11 11:58:52.465: W/dalvikvm(16989): VFY: unable to resolve static field 1363 (common_google_play_services_install_title) in Lcom/google/android/gms/R$string

I have cleaned and ran app this with every jar / project of the google librarys i could find.

this is my connection code

String scope = "oauth2:server:client_id:MY_ID:api_scope:" + Scopes.PLUS_LOGIN;
        String token = "";
        Bundle appActivities = new Bundle();
        appActivities.putString(GoogleAuthUtil.KEY_REQUEST_VISIBLE_ACTIVITIES,
                  "MY_ACTIVITY" );
        try {
            // We can retrieve the token to check via
            // tokeninfo or to pass to a service-side
            // application.
            mAccountName = mPlusClient.getAccountName();
            mAccessToken = GoogleAuthUtil.getToken(mContext, mAccountName, scope, appActivities);
        } catch (GooglePlayServicesAvailabilityException playEx) {
            Dialog dialog = GooglePlayServicesUtil.getErrorDialog(
                    playEx.getConnectionStatusCode(), mContext,

                    0);
            // Use the dialog to present to the user.
        } catch (UserRecoverableAuthException recoverableException) {
            Intent recoveryIntent = recoverableException.getIntent();
            startActivityForResult(recoveryIntent, 8);
        } catch (IOException e) {
            e.printStackTrace();
        } catch (GoogleAuthException e) {
            e.printStackTrace();
        }

1个回答

    最佳答案
  1. ** WARNING IF YOU HAVE SPENT A LARGE AMOUNT OF TIME ON THIS ISSUE ******

    Follow these steps:

    1. Find something soft, big and unbreakable
    2. Sit down and buckle yourself in

    So basically for me i resolved this issue by guess and check 40x and hopefully it works for you. So it turns out that my issues was the order in which i added the clientIds to the api console. First i added the SERVICE ACCOUNT then the WEB APPLICATIONS lastly ANDROID APPLICATION. The trick here is that i used the ClientID for the web application not the SERVICE OR ANDROID one. Idk why but that is the one that worked. I had cases before when the ClientID of the service account worked but didn't work when exchanging on the server side for the real access token. Anyway this process evolved a lot of guessing and hopefully it works for you. And remember that big soft object to let out your anger at (Hopefully not your local google dev)