java - how to add a library to the dependencies gradle of LIBGDX project -


all in question , i've tried answers found in , others sites no luck , i've tried far :

adding compile filetree(dir: 'lib', include: '*.jar') build.gradle

adding compile files('lib/tween-engine-api-sources.jar') build.gradle

the library want add tween engine .

build.gradle file :

buildscript {     repositories {         mavencentral()         maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }     }     dependencies {     } }  allprojects {     apply plugin: "eclipse"     apply plugin: "idea"      version = '1.0'     ext {         appname = 'my-gdx-game'         gdxversion = '1.5.4'         robovmversion = '1.0.0-snapshot'         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"         compile "com.badlogicgames.gdx:gdx-bullet-platform:$gdxversion:natives-desktop"         compile "com.badlogicgames.gdx:gdx-freetype-platform:$gdxversion:natives-desktop"         compile "com.badlogicgames.gdx:gdx-tools:$gdxversion"         compile "com.badlogicgames.gdx:gdx-controllers-desktop:$gdxversion"         compile "com.badlogicgames.gdx:gdx-controllers-platform:$gdxversion:natives-desktop"       } }  project(":core") {     apply plugin: "java"       dependencies {         compile "com.badlogicgames.gdx:gdx:$gdxversion"         compile "com.badlogicgames.gdx:gdx-box2d:$gdxversion"         compile "com.badlogicgames.gdx:gdx-bullet:$gdxversion"         compile "com.badlogicgames.gdx:gdx-freetype:$gdxversion"         compile "com.badlogicgames.gdx:gdx-controllers:$gdxversion"         compile "com.badlogicgames.gdx:gdx-ai:$aiversion"         compile "com.badlogicgames.ashley:ashley:$ashleyversion"         compile "com.badlogicgames.box2dlights:box2dlights:$box2dlightsversion"          compile filetree(dir: 'lib', include: '*.jar')      } }  tasks.eclipse.dolast {     delete ".project" } 

in wiki article dependency management gradle, can find information need. there's part tween engine.

your approach should work, however, need update eclipse via right-click on projects -> gradle -> refresh dependencies.

for me worked better though install dependencies in local repository , reference there, instead of referencing lib folder. described here.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -