我知道有一百万个关于这个的帖子,我都读过了。我尝试登录时不断出现内部错误。我尝试了多个 android-support-v4 和 google-play-services jar 文件。我曾尝试将谷歌播放服务作为图书馆。
我得到的唯一警告是这个
03-11 11:58:52.465: W/dalvikvm(16989): VFY: unable to resolve static field 1363 (common_google_play_services_install_title) in Lcom/google/android/gms/R$string
我已经用我能找到的谷歌库的每个 jar / 项目清理并运行了这个应用程序。
这是我的连接代码
String scope = "oauth2:server:client_id:MY_ID:api_scope:" + Scopes.PLUS_LOGIN;
String token = "";
Bundle appActivities = new Bundle();
appActivities.putString(GoogleAuthUtil.KEY_REQUEST_VISIBLE_ACTIVITIES,
"MY_ACTIVITY" );
try {
// We can retrieve the token to check via
// tokeninfo or to pass to a service-side
// application.
mAccountName = mPlusClient.getAccountName();
mAccessToken = GoogleAuthUtil.getToken(mContext, mAccountName, scope, appActivities);
} catch (GooglePlayServicesAvailabilityException playEx) {
Dialog dialog = GooglePlayServicesUtil.getErrorDialog(
playEx.getConnectionStatusCode(), mContext,
0);
// Use the dialog to present to the user.
} catch (UserRecoverableAuthException recoverableException) {
Intent recoveryIntent = recoverableException.getIntent();
startActivityForResult(recoveryIntent, 8);
} catch (IOException e) {
e.printStackTrace();
} catch (GoogleAuthException e) {
e.printStackTrace();
}