我在 Android 中运行代码时遇到此错误,这是关于 gradle 但我已经在 build.gradle 中添加了这个东西
repositories {
jcenter()
google()
}
请帮忙提前谢谢
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = "27.0.3"
minSdkVersion = 16
compileSdkVersion = 27
targetSdkVersion = 26
supportLibVersion = "27.1.1"
}
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.+' // <- USE 2.2.+ version
}
}
allprojects {
repositories {
// Add jitpack repository (added by tipsi-stripe)
maven { url "https://jitpack.io" }
mavenLocal()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
google()
}
}
task wrapper(type: Wrapper) {
gradleVersion = '4.4'
distributionUrl = distributionUrl.replace("bin", "all")
}
这是我的构建 gradle,它说第 13 行有问题
最佳答案
检查您的 gradle-wrapper.properties 文件并将 distributionUrl 更改为
distributionUrl=https://services.gradle.org/distributions/gradle-4.1-all.zip
关于javascript - React native Android 给出关于 gradle 的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53423911/