【发布时间】:2013-10-17 13:11:05
【问题描述】:
我已经阅读了很多关于这个主题的答案,但无法解决我的问题,这里是:
我有一个 gradle 项目,它是一个游戏,我想在该游戏中添加谷歌游戏服务,就像我成功使用 'type-a-number' 所做的那样(这不是一个 gradle 项目)。
但我收到以下错误:
Gradle: error: package com.google.example.games.basegameutils does not exist
Gradle: error: cannot find symbol class BaseGameActivity
Gradle: error: cannot find symbol variable super
注意:在我的活动中,由于来自 BaseGameUtils 的所有红色内容在以下情况后都变为正常:
- 将 BaseGameUtils 作为模块导入,将其作为模块依赖项添加到我的项目中并选中“library mobule”框。
- 将 google-play-services.jar 作为库导入
-
添加到我的 build.gradle 文件(我的模块根目录中的那个):
dependencies { compile 'com.android.support:support-v4:18.+' compile 'com.google.android.gms:play-services:3.+' }==> 是否可以在这里添加 BaseGameUtils 依赖项?
尝试勾选/取消勾选 BaseGameUtils 依赖项的导出框
- 试图将“编译”更改为“提供”
-
将 settings.gradle 更改为
include ':MyModule' '(:libraries):BaseGameUtils'
(一次使用 :libraries,一次不使用)
上面列出的都没有用..
我做错了什么?
我错过了什么?
【问题讨论】:
标签: android dependencies gradle google-play-games build.gradle