1

when implementing Google+ share i do the following in onCreate:

mGoogleClient = new GoogleApiClient.Builder(this)
    .addApi(Drive.API)
    .addScope(Drive.SCOPE_FILE)
    .addScope(Plus.SCOPE_PLUS_LOGIN)
    .addConnectionCallbacks(this)
    .addOnConnectionFailedListener(this)
    .build();

i conntect to Google after onClick on a button:

mGoogleClient.connect();

then callback is called:

@Override
public void onConnectionFailed(ConnectionResult result) {
    // TODO Auto-generated method stub
    Log.e("GoogleClient","connection failed!");
    Log.e("result",""+ result.getErrorCode());
    if (result.hasResolution()) {
        try {
            result.startResolutionForResult(this, REQUEST_CODE_RESOLVE_ERR);
        } catch (SendIntentException e) {
            mGoogleClient.connect();
        }
    }
    // Speichern Sie das Ergebnis und beheben Sie den Verbindungsfehler bei einem Klick des Nutzers.
    mGoogleConnectionResult = result;

}

And i get Error Code 8, 12-28 22:39:56.286: E/result(15533): ConnectionResult{statusCode=INTERNAL_ERROR, resolution=null}.

I added my APK to Google and got a valid release key. I know that because the first time i tried to share it works like a charm and i was able to share on my Google+ page. If i tried it again nothing happens, not even the Choose Google-account Dialog appears. If i uninstall my app and reinstall it and then try again, Choose Google-account Dialog appears when i choose my Google Account as i did the first time i get Error Code 8 -----> 12-28 22:39:56.286: E/result(15533): ConnectionResult{statusCode=INTERNAL_ERROR, resolution=null}.

I got the latest Android SDK and the latest Google Play Services.

Any help is appreciated.

MMike
  • 598
  • 3
  • 23
  • ccording to https://developers.google.com/+/mobile/android/share/, you do not need to call `connect()``. You just need to launch an Intent. – joao2fast4u Dec 28 '14 at 22:26
  • 1
    @joao2fast4u that is so true. It fixed the Problem and now it works like a charm everytime. You can post it as an answere i will mark as accepted. But anyway, it is just luck that `googe+ share` don't Need to be connected. It would be interesting why this is not working when trying to connect.. Thank you very much! – MMike Dec 28 '14 at 22:37

1 Answers1

0

According to Google Developers website, you do not need to call connect() to share with Google Plus. You just need to launch a Share Intent.

Edit: About your last comment, the possible cause to your issue is explained here.

Community
  • 1
  • 1
joao2fast4u
  • 6,868
  • 5
  • 28
  • 42