Frage

I am trying to include a PlusOneButton to my Android App. I created the app on google cloud console with the SHA-1 from my debug.keystore as described by google (https://developers.google.com/+/mobile/android/getting-started?hl=en).

In my XML-Layout I add the +1-Button:

<com.google.android.gms.plus.PlusOneButton
    android:id="@+id/btnPlusOne"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    plus:size="standard" />

In my Activity I override onResume() method. Of course I retrieve the object via findViewById(...) first:

public void onResume() {
    super.onResume();
    btnPlusOne.initialize("http://www.google.de", REQUEST_CODE_PLUS_ONE);
}

I also give the permissions in Manifest:

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />

But if I start my app, the PlusOneButton looks gray. If I click on it, a progress bar appears in the button and runs infinitely. On Logcat I get this message:

18367-18367/? W/PlusOneButtonView﹕ Failed to establish connection with status: 8

If I check this in API-Doc (http://developer.android.com/reference/com/google/android/gms/common/ConnectionResult.html#INTERNAL_ERROR) it says something like internal error. But currently I have no idea what could solve this problem?

War es hilfreich?

Lösung

With new Google Play Services 4.1 release this issue was solved in my case.

https://code.google.com/p/google-plus-platform/issues/detail?id=704

Andere Tipps

The button is frozen because with the new update of google play services library, you can only +1 when the user is signed in.The previous library was better as it signed in the user when clicking +1 button but with the new one you have to first sign in the user then the google plus button will be activated. Fellow googlers told me they are working on the fix but we still dont know when the update will be ready.

So if there is a need for google plus sign in, you can include sign in button, then the plus one will work fine but it looks irrelevant to add sign in button just for plus one. I hope Google will fix this soon.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top