Wednesday, June 25, 2014

LibGDX - How to install the Gradle plugin?

After generating the necessary files from the gdx-setup.jar, according to the messages from the console, it is time to Import the Gradle project with the Eclipse IDE.


However, by default, the Eclipse IDE doesn't come with the Gradle Plugin. Where to install it?

The answer actually is available here. However, I am not following the step of the  "Installation from the STS dashboard". Instead, I chose the second option "Installing Gradle Tooling from the update site". Why? Because Eclipse IDE supports that feature.

  1. Copy this link: http://dist.springsource.com/release/TOOLS/gradle (latest release)
  2. In Eclipse Open Help >> Install New Software
  3. Paste a the link into the "Work with" text box.
  4. Click the Add button at the top of the screen.
  5. Ensure that the option "Group Items by Category" is enabled.
  6. Select the top-level node 'Extensions / Gradle Integration'.
  7. Click "Next". This may take a while.
  8. Review the list of software that will be installed. Click "Next" again.
  9. Review and accept licence agreements and Click "Finish".
By following those steps above and restart your Eclipse IDE, you would be able to see the Gradle option when you opt "Import", as shown below:


After the "Next" button, click the "Build Model" (it may take some time to generate the screen similar to the below):

*Note: this image shows a failure example.

Here, you have to SELECT ALL, and click Next/Finish.

If you come across the error message as in the picture: "my-gdx-game-android existing workspace project my-gdx-game-android has the same name", this means your current workspace has the other directories with the same naming. You may create a new workspace or remove the old one.

With this, now the LibGDX is ready to take off. Implement your logic, debug and be ready to package the app for multiple platforms!

1 comment: