【问题标题】:Why the import of gms and com.google.example could not be resolved?为什么 gms 和 com.google.example 的导入无法解析?
【发布时间】:2014-04-29 16:01:11
【问题描述】:

我正在尝试在 Eclipse 上的应用程序中实现 Google Play Services support。我已经下载了google-play-services_lib 并将其链接到我的项目。我还下载了sample games 并从那里提取了BaseGameUtils(无法将其作为库链接到我的项目,因此我手动将其标记为Is Library 复选框,然后将其链接):

但是下面的代码失败了:

import gms.common.api.*;
import com.google.example.games.basegameutils.BaseGameActivity;

对于这两个导入,它都表示无法解决。

更新。我已经用

替换了第一个导入
import com.google.android.gms.common.api.*;

但仍然无法解决第二个导入问题。

【问题讨论】:

    标签: android eclipse google-play-services


    【解决方案1】:

    好的,我已经下载了示例并使用了来自

    的 BaseGameUtils 库
    android-samples-master/BasicSamples/libraries/BaseGameUtils
    

    android-samples-master/eclipse_compat/libraries/BaseGameUtils
    

    应该改为使用。

    那么,google-play-services_lib 应该在 BaseGameUtils 中被引用。

    【讨论】:

    • 嘘。感谢您发布此信息。在这个上浪费了很多时间。
    • eclipse_compat 文件夹在哪里?在 android-samples 文件夹中只有 BasicSamples...
    • @clayton33,看起来他们更改了文件夹结构中的某些内容(文档 - github.com/playgameservices/android-samples - 仍然提到 eclipse_compat)。建议在他们的 github 上提出这个问题。
    【解决方案2】:

    我添加到这个...

    转到根目录 ./android-samples-master/

    从那里跑

    ./Scripts/make_eclipse_compat

    然后这些项目就可以在 Eclipse 中使用了

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-08-15
      • 1970-01-01
      • 1970-01-01
      • 2012-11-22
      • 1970-01-01
      • 1970-01-01
      • 2016-10-28
      相关资源
      最近更新 更多