在 Android Studio 中添加 Overlap2D 库作为依赖项

Adding Overlap2D library as a dependency in Android Studio

我仔细按照此处列出的步骤操作: 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!我无法导入我设置依赖关系的任何 类!

好的,这个问题的关键是删除库中的另一个 Settings.gradle 文件!

看看这个 link:https://code.google.com/p/android/issues/detail?id=65915