Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to resolve: com.facebook.android:facebook-android-sdk:[4,5)

I am using facebook sdk in my project. Facebook SDK works fine till yesterday. but today when I open my project , the build failed and shows error as follows

 Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugApkCopy'.
   > Could not resolve com.facebook.android:facebook-android-sdk:[4,5).
     Required by:
         project :app
      > Could not resolve com.facebook.android:facebook-android-sdk:[4,5).
         > Failed to list versions for com.facebook.android:facebook-android-sdk.
            > Unable to load Maven meta-data from https://jcenter.bintray.com/com/facebook/android/facebook-android-sdk/maven-metadata.xml.
               > Could not GET 'https://jcenter.bintray.com/com/facebook/android/facebook-android-sdk/maven-metadata.xml'.
                  > jcenter.bintray.com
      > Could not resolve com.facebook.android:facebook-android-sdk:[4,5).
         > Failed to list versions for com.facebook.android:facebook-android-sdk.
            > Unable to load Maven meta-data from https://jitpack.io/com/facebook/android/facebook-android-sdk/maven-metadata.xml.
               > Could not GET 'https://jitpack.io/com/facebook/android/facebook-android-sdk/maven-metadata.xml'.
                  > jitpack.io

I tries clean & build and also inavalidate caches .but nothing worked. Also tries some stackoverflow solutions. none of them worked for me

this my repository in build.gradle

 repositories {
    jcenter()
    mavenCentral()
}
allprojects {
    repositories {
        jcenter()
        maven { url "https://jitpack.io" }
    }
}
like image 957
Vinayak B Avatar asked Sep 29 '17 04:09

Vinayak B


1 Answers

Follow the below procedure to resolve the issue:-

  1. Click on Project Structure from the icon available in the tool bar above.

  2. Open Dependencies tab.

  3. select

    com.facebook.android:facebook-android-sdk:[4,5)

  4. Remove the facebook dependency by clicking the minus(-) button on the extreme right side.

  5. Now, Click on Plus(+) button on the right side above Minus button. Select Library dependency

  6. Type Facebook on the search input box and click on the search button.

  7. Choose com.facebook.android:facebook-login. click on Ok. Sync your Gradle.

This will resolve your issue. As it has worked for me.

like image 94
Pravinsingh Waghela Avatar answered Oct 04 '22 16:10

Pravinsingh Waghela