IndicatorFastScroll icon indicating copy to clipboard operation
IndicatorFastScroll copied to clipboard

Failed to resolve

Open xRealNeon opened this issue 3 years ago • 11 comments

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'
}

xRealNeon avatar Apr 19 '22 12:04 xRealNeon

worked for me :)

https://github.com/reddit/IndicatorFastScroll/issues/45#issuecomment-1036194972

enricocid avatar Apr 19 '22 12:04 enricocid

I don't have jcenter in my build.gradle

xRealNeon avatar Apr 19 '22 12:04 xRealNeon

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
    }
}

enricocid avatar Apr 19 '22 12:04 enricocid

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.

xRealNeon avatar Apr 19 '22 12:04 xRealNeon

Add these lines to your top-level build.gradle. Like this: https://github.com/enricocid/Music-Player-GO/blob/main/project/build.gradle

enricocid avatar Apr 19 '22 12:04 enricocid

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'

xRealNeon avatar Apr 19 '22 12:04 xRealNeon

Could you post build.gradle (top-level) and settings.gradle?

enricocid avatar Apr 19 '22 12:04 enricocid

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'

xRealNeon avatar Apr 19 '22 12:04 xRealNeon

When adding jcenter to the settings, it seems to work but marks it as deprecated

xRealNeon avatar Apr 19 '22 12:04 xRealNeon

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. :)

enricocid avatar Apr 19 '22 12:04 enricocid

currently the only good way to use this library is via good old AAR files .

  1. download the 1.4.0 aar from maven central
  2. add it in libs folder
  3. add implementation files('libs/indicator-fast-scroll-1.4.0.aar') in your build.gradle

sachdeva-tagic avatar Jun 28 '23 13:06 sachdeva-tagic