androidlibgdxoverlap2d

Adding Overlap2D library as a dependency in Android Studio


I carefully followed the steps that were listed here: 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')

and this:

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")
    }
} 

After syncing gradle, I got BUILD SUCCESSFUL.

My folder: overlap2d-runtime-libgdx-master is located in the same parent directory as my folder for my project.

However, when I try to access Overlap2DStage, Android Studio tells me that it cannot find the symbol Overlap2DStage! I can't import any of the classes that I've set the dependency for!


Solution

  • Okay, the key to this issue is removing the other Settings.gradle file in the library!

    Check out this link: https://code.google.com/p/android/issues/detail?id=65915