找不到com.android.tools.build:gradle:4.6
我正在尝试运行React本机项目,但出现以下错误: 我在网上搜索,但没有成功 这是我的体形。格雷德尔找不到com.android.tools.build:gradle:4.6,android,react-native,android-gradle-plugin,build.gradle,react-native-android,Android,React Native,Android Gradle Plugin,Build.gradle,React Native Android,我正在尝试运行React本机项目,但出现以下错误: 我在网上搜索,但没有成功 这是我的体形。格雷德尔 // Top-level build file where you can add configuration options common to all sub-projects/modules. apply plugin: "com.github.ben-manes.versions" buildscript { repositories { jcenter()
// Top-level build file where you can add configuration options common to all sub-projects/modules.
apply plugin: "com.github.ben-manes.versions"
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.6'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
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()
}
}
这是我的渐变包装器。属性
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
感谢您的帮助这里没有
com.android.tools.build:gradle:4.6
。4.6是一个渐变版本。Android Gradle插件版本遵循Android Studio版本。因此,最新的Android Gradle插件是com.Android.tools.build:Gradle:3.2.1
因此,改变:
classpath 'com.android.tools.build:gradle:4.6'
致:
classpath 'com.android.tools.build:gradle:3.2.1'