I have just created template Libgdx project (Core,Android,Windows). Core is regular Java project library. There is a dependency in Core to XStream.jar library. Core contains fil
If the library is supported on Android, it will work.
Put it in the Core project's "libs" folder. Add it to its Order & Export tab.
Add it to the Libraries tab of the Android Project. ("Add jars
", not "Add external jars
") And then check it in the Order & Export tab aswell.
That means that projects that depend on the main project will also have gdx.jar on their classpath. However, this doesn't work for Android projects.
This just means that the libraries in the classpath of the Core project aren't automatically added to the Android project (As far as I know, some time ago it did).
If you get the Multiple dex files error. Uncheck private libraries
in the Order & Export tab of the Android project.
You need to fix your
compile fileTree(dir: 'libs', include: '*.jar')
line. If your libs folder is in core project's folder, add above line to
project(":core") {...
dependencies {....
compile fileTree(dir: 'libs', include: '*.jar')
}
}
part of your build.gradle file. And add below line to your Android project's part in the build.gradle file.
project(":android") {...
dependencies {....
compile fileTree(dir: '../libs', include: '*.jar')
}
}
Android must have this line but it is not necessary for other projects.