添加到Gradle project = package的Google Play游戏服务+ BaseGameUtils不存在

Min*_*ino 3 dependencies android gradle google-play-games build.gradle

我已经阅读了很多关于这个主题的答案,但无法解决我的问题,这里是:

我有一个游戏的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
Run Code Online (Sandbox Code Playgroud)

注意:在我的活动中,由于来自BaseGameUtils而变红的所有内容在以下情况后变为正常:

  • 导入BaseGameUtils作为模块,将其作为模块依赖项添加到我的项目中并检查"库mobule"框.
  • 导入google-play-services.jar作为库
  • 添加到我的build.gradle文件(我的模块根目录中):

    dependencies {
        compile 'com.android.support:support-v4:18.+'
        compile 'com.google.android.gms:play-services:3.+'
    }
    
    Run Code Online (Sandbox Code Playgroud)

    ==>是否有可能在这里添加BaseGameUtils依赖项?

  • 试图检查/取消选中BaseGameUtils依赖项的导出框

  • 试图将'编译'改为'提供'
  • 将settings.gradle更改为

    include ':MyModule' '(:libraries):BaseGameUtils'
    
    Run Code Online (Sandbox Code Playgroud)

(有一次:图书馆,一次没有)

上面没有列出任何工作..

我做错了什么?

我错过了什么?

ian*_*ake 5

你的settings.gradle应该是:

include ':MyModule', ':BaseGameUtils'
Run Code Online (Sandbox Code Playgroud)

请注意逗号.

build.gradleMyModule也应该有

dependencies {
    compile 'com.android.support:support-v4:18.+'
    compile 'com.google.android.gms:play-services:3.+'
    compile project(':BaseGameUtils')
}
Run Code Online (Sandbox Code Playgroud)