Developer Software
Developer Software

Reputation: 31

I have issue with facebook-android-sdk

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
   > Could not resolve com.facebook.android:facebook-android-sdk:latest.release.
     Required by:
         project :app
      > Skipped due to earlier error
      > Failed to list versions for com.facebook.android:facebook-android-sdk.
         > Unable to load Maven meta-data from https://api.mapbox.com/downloads/v2/releases/maven/com/facebook/android/facebook-android-sdk/maven-metadata.xml.
            > Could not get resource 'https://api.mapbox.com/downloads/v2/releases/maven/com/facebook/android/facebook-android-sdk/maven-metadata.xml'.
               > Could not GET 'https://api.mapbox.com/downloads/v2/releases/maven/com/facebook/android/facebook-android-sdk/maven-metadata.xml'. Received status code 403 from server: Forbidden
   > Could not resolve com.facebook.android:audience-network-sdk:6.11.0.
     Required by:
         project :app > com.google.ads.mediation:facebook:6.11.0.0
      > Skipped due to earlier error
      > Could not resolve com.facebook.android:audience-network-sdk:6.11.0.
         > Could not get resource 'https://api.mapbox.com/downloads/v2/releases/maven/com/facebook/android/audience-network-sdk/6.11.0/audience-network-sdk-6.11.0.pom'.
            > Could not GET 'https://api.mapbox.com/downloads/v2/releases/maven/com/facebook/android/audience-network-sdk/6.11.0/audience-network-sdk-6.11.0.pom'. Received status code 403 from server: Forbidden

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

Open Dependencies tab.

select

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

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

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

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

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

and

 1)Remove this line from app/build.gradle ===>
 implementation 'com.facebook.android:facebook-android-sdk:[5,6)'

 2)Add this line in app/build.gradle ===>
  implementation 'com.facebook.android:facebook-android- 
  sdk:latest.release'

 3)Add this in android/build.gradlew 
 allprojects {
repositories {


    google()
    mavenLocal()
    maven {
        // Android JSC is installed from npm
        url("$rootDir/../node_modules/jsc-android/dist")
    }
   mavenCentral().  <====== Add this
    google()
    jcenter()
    maven { url 'https://www.jitpack.io' }
  }
}

BUT NOT WORK

Upvotes: 0

Views: 367

Answers (1)

Gaurav Bansal
Gaurav Bansal

Reputation: 1

In the app's build.gradle add

implementation 'com.facebook.android:facebook-android-sdk:12.3.0'

inside the dependencies element

Upvotes: 0

Related Questions