Home > database >  Import RealmRecyclerViewAdapter throught mavenCentral() instead of jcenter()
Import RealmRecyclerViewAdapter throught mavenCentral() instead of jcenter()

Time:11-11

This is a pretty straightforward question I would like to use the RealmRecyclerViewAdapter library on my project, but when I try to import it using mavenCentral() on my dependencies I got this error:

* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not find io.realm:android-adapters:3.1.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/io/realm/android-adapters/3.1.0/android-adapters-3.1.0.pom
       - https://repo.maven.apache.org/maven2/io/realm/android-adapters/3.1.0/android-adapters-3.1.0.pom
     Required by:
         project :app

However if I just use jcenter() it works fine.

I'm changing it here at my module gradle file:

repositories{
    jcenter()
    //mavenCentral()
}

Is there any way to import this using mavenCentral() ?

CodePudding user response:

I have a method which can help you get this library through jitpack.io repository. First, add the repository in the repositories {} block like this:

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

Then add the dependency like this:

dependencies {
 implementation 'com.github.realm:realm-android-adapters:v3.1.0'
}

CodePudding user response:

No there is no way , Because its not even available on mavenCentral() .

As you can see here in the Note section

Note: this artifact is located at Realm repository (https://dl.bintray.com/realm/maven/)

So what you need to do is the following

maven {
        url "https://dl.bintray.com/realm/maven/"
    }

This way it should be accessable with no need to jcenter()

  • Related