Android Studio 3.1 : Could not find org.jetbrains.trove4j:trove4j:20160824

Try to replace all occurences of mavenCentral() with jcenter() in your gradle builds


I had the same mistake ... and for me the following worked:

  1. Add jcenter() to repositories {} of allprojects
  2. And add compile 'org.jetbrains.trove4j: trove4j: 20160824' in the build.gradle app module

Because jCenter will close in May, you should replace it with Maven. Thanks to @giorgos.nl now we can add Trove4j:20160824.

In root build.gradle write:

buildscript {
    repositories {
        google()
        maven {url 'https://plugins.gradle.org/m2/' }
    }
}

allprojects {
    repositories {
        google()
        mavenCentral()
        // org.jetbrains.trove4j:trove4j:20160824.
        maven { url 'https://plugins.gradle.org/m2/' }
    }
}

To add libraries that have not still been moved to mavenCentral, use this method.

Root build.gradle:

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

Then you should search GitHub repositories of not resolved libraries. App's build.gradle example with two libraries:

dependencies {
    // When a library has tags.
    implementation 'com.github.RedMadRobot:input-mask-android:6.0.0'
    // When a library doesn't have tags.
    implementation 'com.github.savvisingh:DateRangePicker:master'
}

Now we can launch an application and build apk without errors.