You should figure out the Gradle configuration issues as LibGDX will be pulled automatically from Maven and you’ll update LibGDX versions used via the Gradle build config files as well. I am assuming without more info that the problem you are facing regards a mismatch in the Gradle config files the LibGDX project creator is outputting and the latest Android Studio Gradle / build setup.
Here is how you can verify which Gradle build number you should use. First create a normal Android app in Android Studio. This will be your reference, so that you can verify the Gradle config information. You’ll want to look at the top level build.gradle file under your main project directory. The very top of it should look like this:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.12.+'
}
}
Take note of the classpatch dependency for gradle version number; above this is “0.12.+”
Now create a LibGDX project and open the build.gradle file in the parent directory.
It may look like this:
buildscript {
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.10.+'
classpath 'com.github.jtakakura:gradle-robovm-plugin:0.0.10'
}
}
allprojects {
apply plugin: "eclipse"
apply plugin: "idea"
version = '1.0'
ext {
appName = 'MyGame'
gdxVersion = '1.2.0'
roboVMVersion = '0.0.14'
}
repositories {
mavenLocal()
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url "https://oss.sonatype.org/content/repositories/releases/" }
}
}
If the top Gradle version number is different than the normal Android app you created previously then copy the version number from the normal Android app to the GDX build.gradle file. IE change “0.10.+” to “0.12.+”
Also when you first open up an Android studio project navigate to the directory and click on the top level build.gradle file instead of the top level parent directory.
To resynch the Gradle build in Android Studio you will either be prompted automatically when you make changes to the Gradle build files or what is handy is to kick off updating the Gradle build manually. You do this by selecting from the top Android Studio menu: Tools -> Android -> Sync Project with Gradle files
If your gradle config is correct and in line with the Android Studio versions then Gradle will automatically pull down LibGDX and all dependencies such as RoboVM.
Don’t manually include LibGDX as jar files as that will just complicate things and is not the way to set up a Gradle project especially since LibGDX is configured to pull from Maven repos automatically.
When you need to update your version of LibGDX you update the “gdxVersion” and “roboVMVersion” and then hit the sync project w/ gradle files option and the latest versions will be pulled down.
Again, without having more details on what you are facing this is my assumption of what might be holding you up. Gradle take a bit of time to wrap your head around, but is well worth understanding because it is a powerful build system that both Android Studio and LibGDX uses. Let me know if this helps!