【发布时间】:2013-11-06 14:25:06
【问题描述】:
我正在尝试在我的 Android 应用中包含一个 PlusOneButton。 如 google (https://developers.google.com/+/mobile/android/getting-started?hl=en) 所述,我使用 debug.keystore 中的 SHA-1 在 google 云控制台上创建了该应用程序。
在我的 XML 布局中,我添加了 +1 按钮:
<com.google.android.gms.plus.PlusOneButton
android:id="@+id/btnPlusOne"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
plus:size="standard" />
在我的活动中,我重写了 onResume() 方法。当然,我首先通过 findViewById(...) 检索对象:
public void onResume() {
super.onResume();
btnPlusOne.initialize("http://www.google.de", REQUEST_CODE_PLUS_ONE);
}
我也在 Manifest 中授予权限:
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
但如果我启动我的应用程序,PlusOneButton 看起来是灰色的。如果我点击它,按钮中会出现一个进度条并无限运行。在 Logcat 上,我收到以下消息:
18367-18367/? W/PlusOneButtonView﹕ Failed to establish connection with status: 8
如果我在 API-Doc (http://developer.android.com/reference/com/google/android/gms/common/ConnectionResult.html#INTERNAL_ERROR) 中检查它,它会说类似于内部错误。但目前我不知道什么可以解决这个问题?
【问题讨论】:
-
@chirstopher 我在这里遇到同样的问题。我会在我修复时告诉你。如果你先修复,请告诉我
-
@DivyaRamakrishnan 当然。但目前我真的卡住了。
-
@Christopher 你找到任何解决方案了吗?似乎是一种非常奇怪的行为
-
@RahulVerma 对不起。问题仍然存在,但我没有任何解决方案。 :(
-
Google Plus 上的问题:code.google.com/p/google-plus-platform/issues/detail?id=704
标签: android google-plus google-plus-one