Home > Blockchain >  Material Search Bar from github not working
Material Search Bar from github not working

Time:01-09

I get an error saying "Failed to resolve: com.github.mancj:MaterialSearchBar:0.8.5" any ideas on how to fix this?

my build gradle proj

buildscript {
   repositories {
       google()
       mavenCentral()
       maven { url "https://jitpack.io" }
   }
   dependencies {
       classpath "com.android.tools.build:gradle:7.0.3"
       classpath 'com.google.gms:google-services:4.3.10'
   }
}

task clean(type: Delete) {
   delete rootProject.buildDir
} 

build gradle app:


dependencies {

  .....
   implementation 'com.github.mancj:MaterialSearchBar:0.8.5'



} ```

CodePudding user response:

Try adding this to your project's build.gradle(the one you showed in the first):

allprojects​ { repositories { google() mavenCentral() jcenter() } ​}enter image description here

Edit: Just checked the library you were asking about. It asks you to add that maven { url ....} in the repositories section of allprojects as well:enter image description here

CodePudding user response:

Try adding maven { url "https://jitpack.io" } in your settings.gradle file:

settings.gradle (Project Settings)

dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
    google()
    mavenCentral()
    jcenter() // Warning: this repository is going to shut down soon
    maven { url "https://jitpack.io" }  <-- here
   }
 }
 rootProject.name = "StackOverflow"
 include ':app'

I think this happens because Build is configured to prefer settings repositories over project repositories

  •  Tags:  
  • Related