0

I am making a release build for my project using ./gradlew assembleRelease command but it gives me this error.

> Task :app:checkReleaseAarMetadata FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkReleaseAarMetadata'.
> Could not resolve all files for configuration ':app:releaseRuntimeClasspath'.
   > Could not resolve com.facebook.android:facebook-android-sdk:[8,9).
     Required by:
         project :app
      > 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 HEAD 'https://jcenter.bintray.com/com/facebook/android/facebook-android-sdk/maven-metadata.xml'.
               > org.apache.http.client.ClientProtocolException (no error message)

my build.gradle

  ext {
    buildToolsVersion = "29.0.3"
    minSdkVersion = 21
    compileSdkVersion = 30
    targetSdkVersion = 30
    ndkVersion = "20.1.5948944"
    googlePlayServicesAuthVersion = "16.0.1"
}

2 Answers2

0

To solve this issue just change the compileSdkVersion in your build.gradle file.

Open android > build.gradle file. Change compileSdkVersion from 29 to 30. Change targetSdkVersion from 29 to 30. now run again.

whereJERRY
  • 95
  • 1
  • 6
  • I already changed, but it's still not working. I already changed, but it's still not working ` ext { buildToolsVersion = "29.0.3" minSdkVersion = 21 compileSdkVersion = 30 targetSdkVersion = 30 ndkVersion = "20.1.5948944" googlePlayServicesAuthVersion = "16.0.1" }` – Mikey D'Narith May 09 '22 at 08:26
  • @MikeyD'Narith can i know your react natve version? – whereJERRY May 09 '22 at 08:37
  • here's my react version: react-native-cli: 2.0.1 react-native: 0.64.1 – Mikey D'Narith May 09 '22 at 10:07
  • @MikeyD'Narith Can you try to add this two? googlePlayServicesAuthVersion = "16.0.1" androidXCore = "1.6.0" ext { buildToolsVersion = "29.0.2" minSdkVersion = 21 compileSdkVersion = 29 targetSdkVersion = 29 googlePlayServicesAuthVersion = "16.0.1" androidXCore = "1.6.0" } – whereJERRY May 10 '22 at 09:31
0

To solve this issue just add mavenCentral() in repositories of your project build.gradle. Refer to https://developers.facebook.com/docs/android/getting-started/

  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community May 11 '22 at 10:13