0
\$\begingroup\$

I'm actually developing a game with libgdx and I'd like to create a splash screen. To do this, I must use the Universal Tween Engine. To add the Universal Tween Engine, I followed the instructions of the libgdx doc at this link: https://github.com/libgdx/libgdx/wiki/Universal-Tween-Engine

I created a new directory called "libs" in my project directory (not with Eclipse) and put on it the universal tween engine files I got by downloading the universal tween engine. At this time, I had this:

enter image description here

After that, I made the edits in the dependencies sections of "build.gradle" (by adding this: compile fileTree(dir: '../libs', include: '*.jar') )

Then I tried to refresh the gradle dependencies (by right clicking on my core and android projects and pressing "refresh".)

After restarting eclipse, I tried to work with the universal tween engine by trying to import some of the tween engine (I typed on the top of my main class "import aurelienribon.tweenengine.TweenAccessor;").

The problem is that I got a problem message saying "the import aurelienribon cannot be resolved", even after trying to fix the project setup, I got a message saying that this problem is unresolvable.

What shall I do?

Thanks for your answers.

\$\endgroup\$
  • \$\begingroup\$ Shall I import again my project into Eclipse? \$\endgroup\$ – Dhazard Jan 14 '15 at 15:05
2
\$\begingroup\$

So the solution I found:

  1. Re-build the project with GDX setup
  2. Import project
  3. added the following to the build.gradle in the project root under the "android" dependencies and the "core" dependencies section.
  4. clean project
  5. Select all gradle projects, right click on them, gradle->refresh dependencies

That sorted it for me...

compile fileTree(dir: '../libs', include: '*.jar')

Implemented like this:

buildscript {
    repositories {
        mavenCentral()
        jcenter()
    }

    dependencies {
        classpath 'de.richsource.gradle.plugins:gwt-gradle-plugin:0.6'
        classpath 'com.android.tools.build:gradle:1.0.0'
        classpath 'org.robovm:robovm-gradle-plugin:1.0.0-beta-03'
    }
}

allprojects {
    apply plugin: "eclipse"
    apply plugin: "idea"

    version = '1.0'

    ext {
        appName = 'Tiddalick'
        gdxVersion = '1.5.3'
        roboVMVersion = '1.0.0-beta-03'
        box2DLightsVersion = '1.3'
        ashleyVersion = '1.3.1'
        aiVersion = '1.5.0'
    }

    repositories {
        mavenCentral()

        maven {
            url "https://oss.sonatype.org/content/repositories/snapshots/"
        }

        maven {
            url "https://oss.sonatype.org/content/repositories/releases/"
        }
    }
}

project(":desktop") {
    apply plugin: "java"


    dependencies {
        compile project(":core")
        compile "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
        compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
        compile "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-desktop"
    }
}

project(":android") {
    apply plugin: "android"

    configurations {
        natives
    }

    dependencies {
        compile project(":core")
        compile "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"

        natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi"
        natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a"
        natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86"

        compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"

        natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi"
        natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi-v7a"
        natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-x86"

        compile fileTree(dir: '../libs', include: '*.jar')
    }
}

project(":ios") {
    apply plugin: "java"
    apply plugin: "robovm"

    configurations {
        natives
    }

    dependencies {
        compile project(":core")
        compile "org.robovm:robovm-rt:${roboVMVersion}"
        compile "org.robovm:robovm-cocoatouch:${roboVMVersion}"
        compile "com.badlogicgames.gdx:gdx-backend-robovm:$gdxVersion"

        natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios"
        natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-ios"
    }
}

project(":html") {
    apply plugin: "gwt"
    apply plugin: "war"


    dependencies {
        compile project(":core")
        compile "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion"
        compile "com.badlogicgames.gdx:gdx:$gdxVersion:sources"
        compile "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion:sources"
        compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion:sources"
        compile "com.badlogicgames.gdx:gdx-box2d-gwt:$gdxVersion:sources"
    }
}

project(":core") {
    apply plugin: "java"


    dependencies {
        compile "com.badlogicgames.gdx:gdx:$gdxVersion"
        compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"

        compile fileTree(dir: '../libs', include: '*.jar')
    }
}

tasks.eclipse.doLast {
    delete ".project"
}
\$\endgroup\$
-1
\$\begingroup\$

It is very easy to resolve.

Step-1: select whole project >right click> gradle >Refresh Dependency
Step-2: right click on error > Fix Project Setup

you are done!

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.