libGDX 1.6.1 released – Build System Change!

libGDX 1.6.1

This release contains a major change to the build system. I had to change the way the iOS project handles native libraries. Up until today, the ios/build.gradle file had a two tasks, copyNatives, and updateRoboVMXML. When you import your project into an IDE or build it via the CLI, these tasks will walk through all dependencies, extract the static libraries and rewrite your robovm.xml file. That’s not really nice.

This release fixes this long standing issue. iOS native libraries, e.g. for gdx code, freetype, bullet or box2d, are now packaged using RoboVMs Jar layout for native libs. The static libraries are stored inside a jar, in the directory META-INF/robovm/ios/libs. Additionally, a small robovm.xml file is stored in META-INF/robovm/ios/robovm.xml. This file specifies the native libraries in the libs directory that RoboVM should link.

If you update an existing project to libGDX 1.6.1, you need to make a few changes to the build.gradle and ios/build.gradle files of your project!

In the root build.gradle file, you will see something like this for the iOS project:

You need to change the natives config name to compile, just like what we use for the normal Java dependencies.

In the ios/build.gradle file, can remove the copyNatives and updateRoboVMXML tasks and any other line that references those tasks. You should end up with something like this (modulo your main class name!):

After this changes, simply set the gdxVersion in your root build.gradle to “1.6.1” and you are done.

Here are the full CHANGES for this release:

ROBOPODS

In other news, if you are interested in libGDX plus iOS you should cast your vote for RoboPods. RoboPods are bindings to 3rd party libraries like Admob, Google Play Game Services and so on that we at RoboVM will officially support going forward. See this blog post, including the poll.

Happy Coding!

4 thoughts on “libGDX 1.6.1 released – Build System Change!

  1. Awesome!

    Also, you may need to delete the following lines from your robovm.xml file:

    build/libs/ios/libgdx.a
    build/libs/ios/libObjectAL.a

  2. As Oscar pointed out, you also need to remove entries in ios/robovm.xml that refer to old pre-1.6.1 native libraries. If you don’t, you’ll likely see ‘duplicate symbol’ errors during iOS builds.

    From doing a diff of my project files with those of a fresh 1.6.1 project, I made the following changes to ios/robovm.xml :-

    build/libs/ios/libgdx-box2d.a
    build/libs/ios/libgdx.a
    build/libs/ios/libObjectAL.a

    Should become:-

    z

    You can also remove the following line from the ios section of your root project’s build.gradle file:-

    configurations { natives }

  3. Good job. I also had to remove the following line from my build.gradle

    natives “com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios”

Leave a Reply

Your email address will not be published.