【问题标题】:GoogleAuthUtil cannot be resolvedGoogleAuthUtil 无法解析
【发布时间】:2013-03-27 17:19:11
【问题描述】:

我在我的 Android 应用程序中使用 Google Play 服务的授权和 GoogleAuthUtil。我大约 2 个月前做了这部分,从那以后它一直工作得很好。昨天,我更新了 SDK。现在我在我的应用程序中遇到了这个错误。它说“无法解析 GoogleAuthUtil”。
更新后的 SDK 有什么变化吗?
我该如何解决这个问题?

我正在导入以下内容:

import com.google.android.gms.auth.GoogleAuthException;
import com.google.android.gms.auth.GoogleAuthUtil;
import com.google.android.gms.auth.GooglePlayServicesAvailabilityException;
import com.google.android.gms.auth.UserRecoverableAuthException.

我得到了

com.google.android.gms.auth 无法解析。

【问题讨论】:

  • 我正在导入以下内容:import com.google.android.gms.auth.GoogleAuthException;导入 com.google.android.gms.auth.GoogleAuthUtil;导入 com.google.android.gms.auth.GooglePlayServicesAvailabilityException;导入 com.google.android.gms.auth.UserRecoverableAuthException。我得到 com.google.android.gms.auth 无法解决。

标签: android google-play-services google-authentication


【解决方案1】:

每当您更新任何库时,请务必先将其从您的参考文献中删除,然后再将其添加到您的参考文献中。之后清理项目。如果需要,重新启动 Eclipse。我觉得你很高兴! :)

【讨论】:

  • 我也有同样的问题。你能解释一下如何从引用中添加和删除。
  • 我的意思是删除所有 JAR 引用并再次添加它们...在 Android 属性中...抱歉迟到的回复
【解决方案2】:

只需从您的 AndroidManifest.xml 中删除 <uses-library> 标记,然后重新启动并清理所有内容。肯定会开始运行的。

【讨论】:

    【解决方案3】:

    如果您使用的是 Android Studio,请按照以下步骤操作。

    1. 打开SDK Manager -> SDK Tool -> 点击Google Play服务并应用
    2. 打开Module Setting 或Project Structure -> 在Dependencies 选项卡上单击+ 按钮-> 选择1.Library Dependency -> 选择play-services (...) 然后单击确定
    3. 通过Build清理你的项目 -> Clean Project

    【讨论】:

      猜你喜欢
      • 2013-08-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-12-14
      • 2013-08-02
      • 1970-01-01
      相关资源
      最近更新 更多