I wanted to add the github library to gradle in Android Studio, but it gave the following error:
Failed to resolve: com.github.warkiz.widget:indicatorseekbar:2.1.2
I needed to add the following repositories, I added them but it still gave the same error.
allprojects {
repositories { ...
maven { url 'https://jitpack.io' }
}
}
My Gradle(The libraries I marked with a yellow pen are the ones that give the same error.):
If you want to use a dependency from GitHub, you need to add:
maven { url 'https://jitpack.io' }
to your repositories
, for example:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
maven { url 'https://jitpack.io' } // this line
google()
mavenCentral()
}
}
However, keep in mind that your provided library may not be still available due to JCenter's discontinuation in February 2021. If the library is not available through JitPack, you might consider adding:
maven { url 'https://maven.aliyun.com/repository/jcenter' }
to access old JCenter repositories as an alternative repository (I tried with your provided library com.github.warkiz.widget:indicatorseekbar:2.1.2
, it worked).
Warning: You should only do this if you really need the library, as it may pose security risks. Always prioritize trusted sources to ensure the safety of your project.