【发布时间】:2014-08-22 11:07:06
【问题描述】:
所以我有一个 LibGdx 游戏,我想在其中添加 Google Play 服务。我正在使用 android studio 但我找不到任何好的教程。
我的游戏根目录中有 BaseGameUtils。我的 settings.gradle 文件看起来像
include 'android', 'ios', 'core', 'BaseGameUtils'
我将 compile project(':BaseGameUtils') 添加到我的 build.gradle 文件的 android 依赖项中,它工作正常,我可以正常使用 android 项目中的类。但是我无法访问核心项目中的类,我想将 GameHandler 传递给游戏,以便我可以使用成就和排行榜。
所以我尝试将同一行添加到 gradle 文件的核心部分,使其看起来像
project(":core") {
apply plugin: "java"
dependencies {
compile "com.badlogicgames.gdx:gdx:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
compile fileTree(dir: '../libs', include: '*.jar')
compile project(':BaseGameUtils')
}
}
但这会导致错误。
Android Studio 给了我这个核心依赖于库但本身不是库错误
【问题讨论】:
标签: android android-studio libgdx google-play-services