New gdx-setup and the Tween Engine (file dependencies)

How do I add the Tween Engine to my project?

Since the old LibGDX setup UI was replaced with the new, gradle-based one, this question has been popping up across the internet.

The Tween Engine is just not included in the gdx-setup, but that doesn't mean you can't add it. In fact, you can still add any libraries you like, just like described in the wiki.

  1. Download from the repository
  2. In the core project, make sure a folder called libs exists.
  3. Extract tween-engine-api.jar to the libs folder.
  4. In the build script (build.gradle) of the root project, add this line to the core project's dependencies closure:
    compile fileTree(dir: "libs", include: "*.jar")

The result may look something like this:

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

    dependencies {
        compile "com.badlogicgames.gdx:gdx:$gdxVersion"
        compile fileTree(dir: "libs", include: "*.jar")

That's it. Gradle will now add all jar files in the libs folder to the dependencies of the core project.

I still get errors in Eclipse!

That's because the .classpath file has not been updated yet, so Eclipse doesn't know you added the Tween Engine.
The gradle eclipse plugin will add all dependencies to the .classpath file for you. Just run this command in the directory of the root project:
./gradlew eclipse (gradlew.bat eclipse if you're using Windows)
To make sure everything works fine, close Eclipse during the process and maybe even import your project again.

Feedback and Knowledge Base