以下是android/build.gradle归档了两个不同项目的内容.

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' }
    }
}

当我执行:react native android时,我得到以下错误.

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'.

请注意,我判断了以下解决方案,但都不起作用

推荐答案

你的一些android依赖项似乎在Jcenter存储库中.

不幸的是,Jcenter是currently down.

你现在有两个选择:

Android相关问答推荐

react-native android项目未找到错误

在delphi中将Jnet_uri转换为Tbitmap

未使用的内容填充参数

在 Android Studio 中保存数据

lambda 函数中的类型不匹配 - Kotlin

AlertDialog android studio

如何在 Jetpack Compose 中将 NavigationRail 的内容居中

带有 GET_SIGNING_CERTIFICATES 的 PackageManager.getPackageArchiveInfo 返回空签名信息

为android中的每种风格替换一个XML文件

Android Studio 与物理设备断开连接

Lombok 插件在最新版本的 Android Studio (Bumblebee) 中不起作用

OnActivityResult 方法已弃用,有什么替代方法?

如何禁用 ViewPager2 中的滑动?

RecyclerView 中最后一个子项的边距/填充

Google Play store中的 Android 版本:选择加入 URL 在哪里?

未找到 SDK 位置.使用 local.properties 文件中的 sdk.dir 或使用 ANDROID_HOME 环境变量定义位置

谷歌登录错误 12500

升级到 Android 8.1 后 startForeground 失败

无法合并 dex

“没有足够的信息来推断参数 T”与 Kotlin 和 Android