【问题标题】:NoOptions cannot be resolved to a typeNoOptions 无法解析为类型
【发布时间】:2014-07-23 21:06:54
【问题描述】:

我正在尝试在我的游戏中加入 google play 服务。

我已经导入 BaseGameUtils 项目,当我将他添加到我的工作区时,eclipse 说:

 "NoOptions cannot be resolved to a type" 

还有:

 "The import com.google.android.gms.common.api.Api.ApiOptions cannot be resolved"

它发生在 GameHelper 类中。

这是唯一无法解决的问题。 有人对此有解决方案吗? 我已经尝试了所有方法,但我无法找到一些解决方案。

对不起,我的英语不好。

【问题讨论】:

  • 我看到你已经导入了 BaseGameUtils 项目,但是你导入了 GooglePlayServices 项目吗?
  • 是的,我还在 BaseGameUtils 中创建了它的引用。
  • 您使用的是最新的 BaseGameUtils 和 GooglePlayServices 吗? BaseGameUtils:github.com/playgameservices/android-samples/tree/master/…
  • 我再次从您的链接下载了 BaseGameUtils,导入它,但仍然无法解析 NoOptions。我怎么知道我是否使用了最新的 GooglePlayServices?
  • 转到 Google Play 服务项目的清单。我使用 versionName 4.3.23,一切正常。好像有一个 4.4 刚刚在 5 月发布的:developer.android.com/google/play-services/index.html

标签: java android eclipse libgdx google-play-services


【解决方案1】:

在 build.gradle 中,确保你的依赖项中有这个

dependencies
    {
        compile "com.google.android.gms:play-services:5.0.+"
    }

【讨论】:

    猜你喜欢
    • 2015-10-22
    • 1970-01-01
    • 2021-08-28
    • 2013-12-14
    • 2015-06-10
    • 2015-11-22
    • 1970-01-01
    • 2011-12-31
    • 2012-09-27
    相关资源
    最近更新 更多