0

我知道有一百万个关于这个的帖子,我都读过了。我尝试登录时不断出现内部错误。我尝试了多个 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();
        }
4

1 回答 1

0

**如果您在此问题上花费大量时间,请发出警告* ** * **

按着这些次序:

  1. 找一些柔软、大而牢不可破的东西
  2. 坐下来系好安全带

所以基本上对我来说,我通过猜测解决了这个问题并检查了 40 倍,希望它对你有用。所以事实证明,我的问题是我将 clientIds 添加到 api 控制台的顺序。首先我添加了服务帐户,然后是网络应用程序,最后是安卓应用程序。这里的诀窍是我将 ClientID 用于 Web 应用程序,而不是 SERVICE 或 ANDROID 应用程序。不知道为什么,但那是有效的。我之前有过服务帐户的 ClientID 有效但在服务器端交换真实访问令牌时无效的情况。无论如何,这个过程演变了很多猜测,希望它对你有用。并记住那个大的软物体来发泄你的愤怒(希望不是你当地的谷歌开发者)

于 2013-08-29T22:43:17.667 回答