Question

According to the Libgdx wiki, I should have a "gdxVersion = ..." line in my grade build file (I'm assuming of my core project). However, I do not. Is there some other way to update my libgdx?

build.gradle:

    apply plugin: "java"

    sourceCompatibility = 1.6

    sourceSets.main.java.srcDirs = [ "src/" ]

    eclipse.project {
            name = appName + "-core"
    }
Was it helpful?

Solution

Taken from the wiki:

Open up the build.gradle file in the root of your project, and locate the following line:

gdxVersion = "1.0.0"

That means you should not edit the build.gradle file in your core project, but in the root folder of your projects.

After that you should proceed according to your IDE as it's described in the wiki article.

OTHER TIPS

Find out build.gradle in root of your project

allprojects {
    apply plugin: "eclipse"
    apply plugin: "idea"

    version = '1.0'
    ext {
        appName = "XYZ"
        gdxVersion = '1.8.0'
        roboVMVersion = '1.12.0'
        box2DLightsVersion = '1.4'
        ashleyVersion = '1.7.0'
        aiVersion = '1.7.0'
        visRuntime = '0.3.1'
        visUI = '1.0.0'
        overlap2D = '0.1.0'
    }

    repositories {
        mavenCentral()
        maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
        maven { url "https://oss.sonatype.org/content/repositories/releases/" }
    }
}

update your gdxVersion with newer version.

Usually updating gradle in the middle of a project or during an update messes up a lot of things. Just make sure your Libgdx version can handle newet Gradle versions. Most of the time you will receive a build error and will spend hours to fix that.

In my opinion, If you are not an expert just leave it be.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top