Search code examples
android-studiogradlelibgdx

Upgrading libGdx and Gradle project results in build errors


I have an older libGdx project that uses version 1.9.1 and Gradle 2.4. I`ve tried upgrade to libGdx 1.9.11 and Gradle 6.5. But I get the following build error:

Gradle sync failed: Could not find org.jetbrains.trove4j:trove4j:20160824. Searched in the following locations: - https://repo.maven.apache.org/maven2/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.pom - https://oss.sonatype.org/content/repositories/snapshots/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.pom - https://dl.google.com/dl/android/maven2/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.pom Required by: project : > com.android.tools.build:gradle:4.1.1 > com.android.tools.build:builder:4.1.1 > com.android.tools:sdk-common:27.1.1

How can I solve it?


Solution

  • Add jcenter() in your root build.gradle file

    repositories {
            jcenter()   // <- Add this
            mavenLocal()
            mavenCentral()
            maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
            maven { url "https://oss.sonatype.org/content/repositories/releases/" }
            google()
        }
    

    Then sync your project with gradle file. Make sure gradle is not in offline mode and you've good network connection.