我仔细按照此处列出的步骤操作: http://overlap2d.com/making-physics-based-side-scroller-project-setup-part-1/
include 'desktop', 'core', 'Overlap2dRuntime'
project(':Overlap2dRuntime').projectDir = new File(settingsDir, '../overlap2d-runtime-libgdx-master')
和此:
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 "com.badlogicgames.box2dlights:box2dlights:1.2"
compile project(":Overlap2dRuntime")
}
}
在同步gradle后,我获得了成功。
我的文件夹:overlap2d-runtime-libgdx-master与我项目的文件夹位于同一个父目录中。
但是,当我尝试访问Overlap2DStage时,Android Studio告诉我它无法找到符号Overlap2DStage!我无法导入我为其设置依赖项的任何类!
答案 0 :(得分:2)
好的,这个问题的关键是删除库中的其他Settings.gradle文件!
点击此链接:https://code.google.com/p/android/issues/detail?id=65915