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

Google plus client "An internal error occured"

Last day I started to receive "An internal error occured" while trying to sign user with Google Plus in my application, that I used well and have not changed. The code has not changed for a long time.

GmsClient returns

connect: bindService returned true for Intent { act=com.google.android.gms.plus.service.START }
service broker connected, binder: android.os.BinderProxy@40fdbd20

And right after that shows toast message "An internal error occured".

I tried to compile Google SDK+ samples and run on the same device but it shows the same error. Maybe something changed in Google APIs?

4个回答

    最佳答案
  1. This is too dumb but I have not found any information googling internet and groups. But it solved replacing:

    //static final String[] SCOPES = new String[] { Scopes.PLUS_PROFILE, PLUS_WRITE_MOMENT };
    static final String[] SCOPES = new String[] { Scopes.PLUS_PROFILE };
    

    Seems the error occured because of PLUS_WRITE_MOMENT... I don't understand why, but without this it works.

    I like google...

  2. 参考答案2
  3. My "internal error occur" solution:

    Follow the demo of https://developers.google.com/+/mobile/android/getting-started

    it create the PlusClient by

    mPlusClient = new PlusClient.Builder(this, this, this)
                    .setVisibleActivities("XXXX/AddActivity", "XXXX/BuyActivity")
                    .setScopes("PLUS_LOGIN")  // Space separated list of scopes
                    .build();
    

    And in my own app, when I remove ".setScopes("PLUS_LOGIN")" and show as:

    mPlusClient = new PlusClient.Builder(this, this, this)
            .setVisibleActivities("XXXX/AddActivity", "XXXX/BuyActivity")
            .build();
    

    The error solved, wired!

  4. 参考答案3
  5. I also had this problem, which suddenly appeared out of nowhere seemingly. Unfortunately, Oleg's answer didn't help me.

    The fix for me was to setup OAuth in the Google APIs Console (https://code.google.com/apis/console). It was very easy to setup. Quickstart instructions here: https://developers.google.com/+/quickstart/android.

    When I first created the project the Simple API Access worked. But, within a month of not changing any code, it wasn't enough.

  6. 参考答案4
  7. My experience / solution:

    I tried everything listed above (checking client id, consent screen, changing scopes, etc.). Nothing solved the issue for me permanently.

    When I viewed the detailed adb logs using this:

    adb shell setprop log.tag.GooglePlusPlatform VERBOSE
    

    I got the following log:

    I/GLSUser (  854): GLS error: BAD_REQUEST xxxxx@gmail.com oauth2:profile https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/plus.me https://www.googleapis.com/auth/contacts.readonly
    

    Finally, what did solve the issue was moving from PlusClient (which is deprecated) to using GoogleApiClient.

    Migration is pretty simple (explained nicely here: http://www.riskcompletefailure.com/2014/02/migrating-from-plusclient-to.html).

    After moving to GoogleApiClient, I never got this error again.