Failed to resolve
When trying to add this dependency, Gradle says that it can not be resolved
Failed to resolve: com.reddit:indicator-fast-scroll:1.4.0
Show in Project Structure dialog
Affected Modules: app
My dependencies
dependencies {
implementation 'com.android.volley:volley:1.2.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'com.reddit:indicator-fast-scroll:1.4.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
worked for me :)
https://github.com/reddit/IndicatorFastScroll/issues/45#issuecomment-1036194972
I don't have jcenter in my build.gradle
Reddit's fastscroller is not available on maven central,. You have to add the jcenter reference to your build.gradle :)
jcenter {
content {
includeGroup "com.reddit" // https://github.com/reddit/IndicatorFastScroll/issues/45
}
}
Grade can not find jcenter
A problem occurred evaluating project ':app'.
> Could not find method jcenter() for arguments [build_ej5zpmzp24s7ygbimo4ptxjaa$_run_closure2@5a55a80e] on project ':app' of type org.gradle.api.Project.
Add these lines to your top-level build.gradle. Like this: https://github.com/enricocid/Music-Player-GO/blob/main/project/build.gradle
Now getting this error
A problem occurred evaluating root project 'Test Launcher'.
> Build was configured to prefer settings repositories over project repositories but repository 'Google' was added by build file 'build.gradle'
Could you post build.gradle (top-level) and settings.gradle?
build.grade
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '7.1.3' apply false
id 'com.android.library' version '7.1.3' apply false
}
task clean(type: Delete) {
delete rootProject.buildDir
}
settings.gradle
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
}
}
rootProject.name = "Test Launcher"
include ':app'
When adding jcenter to the settings, it seems to work but marks it as deprecated
Try to set repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
Yeah, jcenter is deprecated but you can still use it. That's the only way to get this lib. :)
currently the only good way to use this library is via good old AAR files .
- download the 1.4.0 aar from maven central
- add it in libs folder
- add
implementation files('libs/indicator-fast-scroll-1.4.0.aar')in your build.gradle