Android PlusOneButton does not initialize
Asked Answered
O

2

6

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?

Ornithology answered 6/11, 2013 at 14:25 Comment(6)
@chirstopher i am having same problem here.i will let u know when i fix.if u fixed first ,let me knowMello
@DivyaRamakrishnan Of course. But currently I really get stuck.Ornithology
@Ornithology did you find any solution . Seems to be a really strange behaviourAsphyxia
@RahulVerma I'm sorry. The problem still exists, but I do not have any solution. :(Ornithology
Issue on Google Plus: code.google.com/p/google-plus-platform/issues/detail?id=704Ornithology
Someone provides a solution: code.google.com/p/google-plus-platform/issues/detail?id=704#c9 I do not know if it works.Ornithology
O
1

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

Ornithology answered 21/1, 2014 at 12:31 Comment(0)
W
0

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.

Wilber answered 28/12, 2013 at 8:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.