Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to resolve #52

Open
xRealNeon opened this issue Apr 19, 2022 · 11 comments
Open

Failed to resolve #52

xRealNeon opened this issue Apr 19, 2022 · 11 comments

Comments

@xRealNeon
Copy link

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'
}
@enricocid
Copy link
Contributor

worked for me :)

#45 (comment)

@xRealNeon
Copy link
Author

I don't have jcenter in my build.gradle

@enricocid
Copy link
Contributor

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

@xRealNeon
Copy link
Author

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.

@enricocid
Copy link
Contributor

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

@xRealNeon
Copy link
Author

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'

@enricocid
Copy link
Contributor

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

@xRealNeon
Copy link
Author

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
Copy link
Author

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

@enricocid
Copy link
Contributor

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

@sachdeva-tagic
Copy link

sachdeva-tagic commented Jun 28, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants