Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LibGDX project doesn't build with Gradle version over 2.9 #4230

Closed
obigu opened this issue Aug 5, 2016 · 5 comments
Closed

LibGDX project doesn't build with Gradle version over 2.9 #4230

obigu opened this issue Aug 5, 2016 · 5 comments

Comments

@obigu
Copy link
Contributor

@obigu obigu commented Aug 5, 2016

When trying to build the libGDX project from source using a Gradle version higher than 2.9 the following error message appears:

Error:Gradle version 2.2 is required. Current version is 2.10. If using the gradle wrapper, try editing the distributionUrl in /XXXXXX/git/libgdx/gradle/wrapper/gradle-wrapper.properties to gradle-2.2-all.zip.

This is because of a limitation on the version of the Android Gradle plugin (com.android.tools.build:gradle) that is set to 1.2.3. The fix to support Gradle 2.10+ was introduced on version 1.5.0 of the Android plugin (this is the fix https://android.googlesource.com/platform/tools/base/+/b96ce169b385d006cfccc4c9f1e54ab47140f59d).

But if we set the com.android.tools.build:gradle version to 1.5.0 a new error appears this time:

`Error:(272, 0) Your project contains 2 or more modules with the same identification com.badlogicgames.gdx:gdx-box2d
at ":extensions:gdx-box2d" and ":extensions:gdx-box2d:gdx-box2d".
You must use different identification (either name or group) for each modules.
Open File``

This error also appears just by setting the com.android.tools.build:gradle version to 1.3.0.

So, if I haven't made a mistake on my tests of course, libGDX is currently stuck on pretty old versions of Gradle and Android Gradle plugin versions until a fix for the box2d modules is found.

Also it looks like the information on the versions page regarding the Android Gradle plugin is not correct https://libgdx.badlogicgames.com/versions.html.

@Tom-Ski
Copy link
Member

@Tom-Ski Tom-Ski commented Aug 5, 2016

That information is what the setup tool uses to generate new projects, not the LibGDX gradle build. There is no wrapper pushed for LibGDX source itself, but running with gradle version 2.5 is fine. It will get updated eventually, what features are you wanting to use from 2.9?

@obigu
Copy link
Contributor Author

@obigu obigu commented Aug 5, 2016

Ok.

None in particular, I just wanted to raise awareness about this limitation in case anybody tries to build it with a current Gradle version and comes across this issue.

3.0 is apparently going to be relased soon and comes with important performance improvements. May be a good time to update, it takes ages to build on my laptop... :(

@Tom-Ski
Copy link
Member

@Tom-Ski Tom-Ski commented Aug 5, 2016

Ok, yeah the updates are infrequent because its such a pita, some plugins always breaks, and if we are lucky its in an obvious way. Then its testing on all IDEs and platforms to see if they are also behaving.

@Fringale
Copy link

@Fringale Fringale commented Aug 12, 2016

Just for reference, I also stumbled on this Your project contains 2 or more modules with the same identification issue when building libGDX using Gradle (and trying to make the Android plugin and Gradle versions match the ones used in libGDX projects).

It is caused by the structure of the libGDX source project (or, in a more snarky way, by the Android plugin adding arbitrary constraints in newer versions): from version 1.3 onward, it seems the Android Gradle plugin doesn’t like when a submodule and its parent share the same name (actually, group + name), like :extensions:gdx-box2d:gdx-box2d, or :extensions:gdx-controllers:gdx-controllers. It doesn’t seem this check can be bypassed, so if the plugin is to be updated one day, some renaming or restructuring for those two modules would unfortunately appear necessary. : (

Some additional information on the subject: http://stackoverflow.com/a/33531721

@Zomby2D
Copy link
Contributor

@Zomby2D Zomby2D commented Aug 29, 2016

With Android Studio strongly recommending updating to Gradle 2.14.1+ (and Android plugin 2.1.3) at every Gradle project sync, which of course breaks the build, this should probably be addressed soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.