React-Native 构建失败无法下载 protobuf-java-3.4.0.jar (com.google.protobuf:protobuf-java:3.4.0)
React-Native build Failed Could not download protobuf-java-3.4.0.jar (com.google.protobuf:protobuf-java:3.4.0)
在 运行ning npx react-native 运行-android 时获取构建失败
错误
配置根项目时出现问题 'AwesomeProject'。
无法解析配置“:classpath”的所有工件。
无法下载 protobuf-java-3.4.0.jar (com.google.protobuf:protobuf-java:3.4.0)
无法获取资源“https://jcenter.bintray.com/com/google/protobuf/protobuf-java/3.4.0/protobuf-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' }
}
}
ERROR SCREENSHOT
解决了,
这是由于一些网络问题我无法访问存储库
在 运行ning npx react-native 运行-android 时获取构建失败 错误
配置根项目时出现问题 'AwesomeProject'。 无法解析配置“:classpath”的所有工件。 无法下载 protobuf-java-3.4.0.jar (com.google.protobuf:protobuf-java:3.4.0) 无法获取资源“https://jcenter.bintray.com/com/google/protobuf/protobuf-java/3.4.0/protobuf-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' }
}
}
ERROR SCREENSHOT
解决了, 这是由于一些网络问题我无法访问存储库