Here are the android/build.gradle files contents of two different project.

PROJECT 1

    ext {
        buildToolsVersion = "29.0.3"
        minSdkVersion = 21
        compileSdkVersion = 29
        targetSdkVersion = 30
        supportLibVersion = "29.0.0"
        googlePlayServicesVersion = "16.0.0"
        firebaseVersion = "17.3.4"
        firebaseMessagingVersion = "20.2.1"
        firebaseBomVersion="20.2.1"
    }
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath("com.android.tools.build:gradle:4.0.1")
        classpath ("com.google.gms:google-services:4.2.0")
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        mavenLocal()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }

        google()
        jcenter()
        maven { url 'https://jitpack.io' }
    }
}

PROJECT 2

buildscript {
    ext {
        kotlin_version = '1.5.0'
        buildToolsVersion = "29.0.2"
        minSdkVersion = 24
        compileSdkVersion = 29
        targetSdkVersion = 29
        androidXCore = "1.7.0"
        googlePlayServicesAuthVersion = "16.0.1"
    }
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath("com.android.tools.build:gradle:3.5.4")
        classpath 'com.google.gms:google-services:4.3.10'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        mavenLocal()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }

        google()
        jcenter()
        maven { url 'https://www.jitpack.io' }
    }
}

When I execute: react-native-android, I get the following error.

PROJECT 1

* What went wrong:
Could not determine the dependencies of task ':app:mergeDebugAssets'.
> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
   > Could not resolve com.facebook.android:facebook-login:[5,6).
     Required by:
         project :app
      > Failed to list versions for com.facebook.android:facebook-login.
         > Unable to load Maven meta-data from https://jcenter.bintray.com/com/facebook/android/facebook-login/maven-metadata.xml.
            > Could not HEAD 'https://jcenter.bintray.com/com/facebook/android/facebook-login/maven-metadata.xml'.
               > org.apache.http.client.ClientProtocolException (no error message)

PROJECT 2

* What went wrong:
Could not determine the dependencies of task ':app:mergeDebugAssets'.
> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
   > Could not resolve com.facebook.android:facebook-login:[8.1).
     Required by:
         project :app
      > Could not resolve com.facebook.android:facebook-login:[8.1).
         > Could not get resource 'https://jcenter.bintray.com/com/facebook/android/facebook-login/%5B8.1)/facebook-login-%5B8.1).pom'.
            > Could not GET 'https://jcenter.bintray.com/com/facebook/android/facebook-login/%5B8.1)/facebook-login-%5B8.1).pom'.
               > org.apache.http.client.ClientProtocolException (no error message)
   > Could not resolve com.facebook.android:facebook-android-sdk:9.0.
     Required by:
         project :app
      > Could not resolve com.facebook.android:facebook-android-sdk:9.0.
         > Could not get resource 'https://jcenter.bintray.com/com/facebook/android/facebook-android-sdk/9.0/facebook-android-sdk-9.0.pom'.
            > Could not GET 'https://jcenter.bintray.com/com/facebook/android/facebook-android-sdk/9.0/facebook-android-sdk-9.0.pom'.
               > org.apache.http.client.ClientProtocolException (no error message)
   > Could not resolve com.facebook.android:facebook-android-sdk:9.0.+.
     Required by:
         project :app > project :react-native-fbsdk-next
      > 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'.

Note that I checked the following solutions but none worked

推荐答案

It seems like some of your android dependencies are in Jcenter repository.

Unfortunately, Jcenter is currently down.

You have two choice for now :

Android相关问答推荐

泛型类型lambda函数参数作为函数参数

Android事件:APP_SCOUT_HANG警告SQLite

格雷德的两个星号是什么意思?非路径

在Jetpack Compose中从LazyColumn中删除项目时发生IndexOutOf边界异常

在柯特林连续测量网速

Android从已连接的设备获得GATT

无法插入 LayoutNode@cc72396 子级,因为它已有父级

如何在C++中使用JNI_GetCreatedJavaVMs调用Java代码

错误:无法安装应用程序:INSTALL_PARSE_FAILED_MANIFEST_MALFORMED (React-Native-Android-Studio)

如何知道我的应用程序的新版本是否显示广告?

在模块 jetified-kotlin-stdlib-1.8.10 中发现重复的类 kotlin.random.jdk8,带有启动基准

LazyColumn 项目,隐式接收器无法在此上下文中调用单元

在 Kotlin 中打开新片段时如何对当前片段应用更改?

如何在 Android Studio 中创建新的可组合函数?

并行运行两个挂起函数并在第一个返回时返回

线圈单元测试 - 如何做到这一点?

房间实时数据:启动时崩溃

在 android-billing-5.0 中获取 ProductDetails 价格

如何获取 Android Preferences DataStore 的所有键

Google API:java.lang.ClassNotFoundException:找不到类sun.misc.Service