【发布时间】:2020-08-24 00:46:46
【问题描述】:
尝试同步 Gradle 时出现以下错误:
A problem occurred configuring project ':react-native-google-signin'.
> Could not resolve all artifacts for configuration ':react-native-google-signin:classpath'.
> Could not find com.android.tools.build:gradle:3.6.3.
Searched in the following locations:
- https://jcenter.bintray.com/com/android/tools/build/gradle/3.6.3/gradle-3.6.3.pom
- https://jcenter.bintray.com/com/android/tools/build/gradle/3.6.3/gradle-3.6.3.jar
Required by:
project :react-native-google-signin
我进行了搜索,但无法找到答案。这里有一个类似的问题:React native android can not find com.android.tools.build:gradle:3.6.3
看上面这表明关闭离线模式,它没有打开,所以很遗憾,这不是答案。
根 bundle.gradle 文件如下所示:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 16
compileSdkVersion = 28
targetSdkVersion = 28
supportLibVersion = "28.0.0-alpha1"
reactNativeVersion = "0.59.9"
googlePlayServicesAuthVersion = "16.0.1"
}
repositories {
google()
maven {
url 'https://maven.google.com/'
}
jcenter()
mavenCentral()
maven {
url 'https://maven.fabric.io/public'
}
maven { url 'https://dl.bintray.com/android/android-tools' }
maven {url "$projectDir/../node_modules/react-native/android"}
}
dependencies {
classpath('com.android.tools.build:gradle:3.4.1')
classpath 'com.google.gms:google-services:4.1.0'
classpath 'io.fabric.tools:gradle:1.25.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
// React native video - exoplayer missing from google repos, temp fix
maven {
url "https://google.bintray.com/exoplayer/"
}
maven {
url 'https://maven.google.com/'
name 'Google'
}
jcenter()
// configurations.all {
// resolutionStrategy {
// force 'com.facebook.android:facebook-android-sdk:4.28.0'
// }
// }
}
}
根据错误,它似乎只在 jcenter 中搜索而不在其他地方搜索?我不确定,但是当我在网上搜索时,这个特定的版本可以从 maven.google.com 获得吗?
【问题讨论】:
-
解决了吗?
-
不,我无法深入了解它。因为我需要一个 react-native 升级,所以我首先在做这个,希望我能把它清理干净
标签: android gradle build.gradle gradle-plugin gradlew