反应式原生构建失败 无法下载 protobuf-java-3.4.0.jar (com.google.protobuf:protobuf-java:3.4.0)

问题描述 投票:0回答:1

当运行npx react-native run-android时,得到构建失败的结果。错误


配置根项目'AwesomeProject'时出现问题,无法解析配置':classpath'的所有构件,无法下载protobuf-java-3.4.0.jar(com.google.protobuf:protobuf-java:3.4.0)。 无法下载protobuf-java-3.4.0.jar (com.google.protobuf:protobuf-java:3.4.0) 无法获取资源':classpath'。https:/jcenter.bintray.comcomgoogleprotobufprotobuf-java3.4.0protobuf-java-3.4.0.jar。'.

下面是我的build.gradle文件

buildscript {
    ext {
        buildToolsVersion = "28.0.3"
        minSdkVersion = 16
        compileSdkVersion = 28
        targetSdkVersion = 28
    }
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath("com.android.tools.build:gradle:3.5.2")

        // 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 gradle react-native-android gradlew
1个回答
0
投票

解决了,这是由于一些网络问题,我无法访问仓库。

© www.soinside.com 2019 - 2024. All rights reserved.