Good morning,
I try to run spine libgdx runtime samples in html platform.
Everything works in others platforms (android, desktop), but it fail to compile in html.
Could I send you my project ?
Or, do you have a project ready to work ?
Thanks by advance,
cheers,
Fred.
Hello,
I found solution to integrate new third party libraries (like Spine Animation) to LibGdx gradle project in Eclipse.
If you want to launch application in html, install 'Eclipse IDE for Java EE Developers' instead of the one specified in LibGdx help.
After project import in Eclipse, for Android:
Android project -> Properties -> Android -> Project build target, select Android (not Google).
If this running installation error occur: INSTALL_FAILED_UPDATE_INCOMPATIBLE, it means the application which you want to install is already installed on the remote device. Just uninstall the old one and try again.
Spine setup
Download runtimes archive: https://github.com/EsotericSoftware/spine-runtimes/archive/master.zip
Extract ‘spine-libgdx’ from inside the archive to the project root path, rename dir ‘spine-libgdx’ to ‘spine’ for convenience.
Add spine’s projects & dependencies to gradle:
That process can be adapted to integrate other 3rd party libraries as well.
-> In each subdirs inside ‘spine’ dir, add a file ‘build.gradle’ copied from than the one in project dir 'core'.
Replace
appName + "-core"
in each files by
"spine-libgdx"
,
"spine-libgdx-tests"
, and
"spine-skeletonviewer"
for each corresponding dirs.
-> in ‘settings.gradle’ (located at the project root), add:
, 'spine:spine-libgdx', 'spine:spine-libgdx-tests', 'spine:spine-skeletonviewer'
-> in ‘build.gradle’ (located at the project root too), after project “:core”, add a section for each spine project:
project(":spine:spine-libgdx") {
apply plugin: "java"
dependencies {
compile "com.badlogicgames.gdx:gdx:$gdxVersion"
}
}
project(":spine:spine-libgdx-tests") {
apply plugin: "java"
dependencies {
compile project(":spine:spine-libgdx")
compile "com.badlogicgames.gdx:gdx:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
}
}
project(":spine:spine-skeletonviewer") {
apply plugin: "java"
dependencies {
compile project(":spine:spine-libgdx")
compile "com.badlogicgames.gdx:gdx:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
}
}
-> In project “:core”, add required dependencies, ex. to compile spine test, add:
compile project(":spine:spine-libgdx-tests")
Importing New Projects
Go to File -> Import -> Gradle -> Gradle Project, click Browse and navigate to the root folder of your project, then click Build Model. Uncheck Eclipse, Select all new projects under and click Finish.
Refresh Projects
Whenever you change something that is relevant for eclipse, right-click on your project and select best-matching "Refresh" command in the menu named "Gradle".
If project “:core” has been changed in ‘build.gradle’ file, it need to be refreshed, right click on it, then select “Gradle->Refresh All”