Unresolved reference error when importing library

Viewed 39

I'm having trouble importing this library: https://github.com/javiersantos/MaterialStyledDialogs

I added the repository to my project build.gradle:

repositories {
    jcenter()
    maven {
        url "https://jitpack.io"
    }
}

And added the library to your module build.gradle:

dependencies {
    implementation 'com.github.javiersantos:MaterialStyledDialogs:3.0.1'
}

But I get this error, why? i think the issue is because of jcenter, mavencentral or jitpack or such

enter image description here

1 Answers

Add those two lines to your settings.gradle file then sync gradle

pluginManagement {
    repositories {
        jcenter()                          // here
        maven {url "https://jitpack.io"}   // here
        gradlePluginPortal()
        google()
        mavenCentral()
    }
}

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        jcenter()                          // here
        maven {url "https://jitpack.io"}   // here
        google()
        mavenCentral()
    }
}
Related