【问题标题】:Google plus client "An internal error occured" [duplicate]Google plus客户端“发生内部错误” [重复]
【发布时间】:2012-12-21 09:00:21
【问题描述】:

最后一天,我在我的应用程序中尝试使用 Google Plus 为用户签名时开始收到“发生内部错误”,我使用得很好并且没有更改。代码很久​​没变了。

GmsClient 返回

connect: bindService returned true for Intent { act=com.google.android.gms.plus.service.START }
service broker connected, binder: android.os.BinderProxy@40fdbd20

然后立即显示 toast 消息“发生内部错误”。

我尝试编译 Google SDK+ 示例并在同一设备上运行,但它显示相同的错误。 也许 Google API 发生了一些变化?

【问题讨论】:

    标签: android google-plus


    【解决方案1】:

    我的“发生内部错误”解决方案:

    关注https://developers.google.com/+/mobile/android/getting-started的演示

    它通过

    创建PlusClient
    mPlusClient = new PlusClient.Builder(this, this, this)
                    .setVisibleActivities("XXXX/AddActivity", "XXXX/BuyActivity")
                    .setScopes("PLUS_LOGIN")  // Space separated list of scopes
                    .build();
    

    在我自己的应用程序中,当我删除“.setScopes("PLUS_LOGIN")”并显示为:

    mPlusClient = new PlusClient.Builder(this, this, this)
            .setVisibleActivities("XXXX/AddActivity", "XXXX/BuyActivity")
            .build();
    

    错误解决,连线!

    【讨论】:

    • 别忘了添加“”权限
    【解决方案2】:

    这太愚蠢了,但我没有在谷歌搜索互联网和群组中找到任何信息。 但它解决了替换:

    //static final String[] SCOPES = new String[] { Scopes.PLUS_PROFILE, PLUS_WRITE_MOMENT };
    static final String[] SCOPES = new String[] { Scopes.PLUS_PROFILE };
    

    似乎错误是因为 PLUS_WRITE_MOMENT... 我不明白为什么,但没有这个它可以工作。

    我喜欢谷歌...

    【讨论】:

    • 我遇到了同样的错误,但不知道怎么解决?
    • 仅供参考:在 2 月 28 日发布 Google+ 登录和新 SDK 之后,此答案现已过时。
    【解决方案3】:

    我也遇到过这个问题,貌似是突然冒出来的。不幸的是,奥列格的回答对我没有帮助。

    我的解决方法是在 Google API 控制台 (https://code.google.com/apis/console) 中设置 OAuth。设置非常容易。此处为快速入门说明:https://developers.google.com/+/quickstart/android

    当我第一次创建项目时,Simple API Access 起作用了。但是,在一个月内不更改任何代码,这还不够。

    【讨论】:

      【解决方案4】:

      我的经验/解决方案:

      我尝试了上面列出的所有内容(检查客户 ID、同意屏幕、更改范围等)。没有什么能永久解决我的问题。

      当我使用这个查看详细的 adb 日志时:

      adb shell setprop log.tag.GooglePlusPlatform VERBOSE
      

      我得到以下日志:

      I/GLSUser (  854): GLS error: BAD_REQUEST xxxxx@gmail.com oauth2:profile https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/plus.me https://www.googleapis.com/auth/contacts.readonly
      

      最后,解决问题的方法是从 PlusClient(已弃用)转移到使用 GoogleApiClient

      迁移非常简单(这里解释得很清楚:http://www.riskcompletefailure.com/2014/02/migrating-from-plusclient-to.html)。

      迁移到 GoogleApiClient 后,我​​再也没有收到此错误。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-11-27
        • 1970-01-01
        相关资源
        最近更新 更多