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
Because jCenter will close in May, you should replace it with Maven. Thanks to giorgos.nl now we can add Trove4j:20160824
. Thanks to Xavier Rubio Jansana we can replace maven { url 'https://plugins.gradle.org/m2/' }
with gradlePluginPortal()
.
In root build.gradle
write:
buildscript { repositories { google() gradlePluginPortal() }}allprojects { repositories { google() mavenCentral() // org.jetbrains.trove4j:trove4j:20160824. gradlePluginPortal() }}
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.
I had the same mistake ... and for me the following worked:
- Add
jcenter()
torepositories {}
ofallprojects
- And add
compile 'org.jetbrains.trove4j: trove4j: 20160824'
in the build.gradle app module