我已经阅读了有关此主题的许多答案,但无法解决我的问题,这里是:
我有一个 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
NOTE :在我的活动中,由于来自 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'
(一次使用:库,一次不使用)
上面列出的没有任何效果..
我做错了什么?
我缺少什么?
Your settings.gradle
应该:
include ':MyModule', ':BaseGameUtils'
注意逗号。
Your build.gradle
for MyModule
还应该有
dependencies {
compile 'com.android.support:support-v4:18.+'
compile 'com.google.android.gms:play-services:3.+'
compile project(':BaseGameUtils')
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)