我正在尝试在一个 friend 的(有点旧)项目上运行react-native run-android
。我收到此错误:
Could not find com.android.tools.build:gradle:3.0.1.
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.jar
Required by:
project :
我试图输入链接,但它们返回404错误。此链接是否放置在配置文件中?在哪里可以获得这些文件的有效链接?修改哪个文件以获得所说的文件?
最佳答案
通过将google()
添加到android/app/build.gradle
文件上的存储库中,解决了该问题。最终结果看起来像
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
jcenter()
google()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
}
}
关于javascript - 找不到com.android.tools.build:graddle-链接返回404,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48832571/