gpt4 book ai didi

android - React Native Android无法找到com.android.tools.build:gradle:3.6.3

转载 作者:行者123 更新时间:2023-12-03 03:41:11 27 4
gpt4 key购买 nike

任何人都遇到了该问题无法解决配置':react-native-fast-image:classpath'的所有 Artifact ,并且找不到com.android.tools.build:gradle:3.6.3吗?我尝试打开项目结构,看到gradle插件工具为3.6.3,gradle版本为5.4.6,但我不知道现在会发生什么

build.gradle文件:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
/*ext {
buildToolsVersion = "28.0.2"
minSdkVersion = 16
compileSdkVersion = 28
targetSdkVersion = 27
supportLibVersion = "28.0.0"
}*/
repositories {
jcenter()
google()
maven {
url 'https://maven.google.com/'
name 'Google'
}
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath 'com.google.gms:google-services:4.0.1'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
configurations.all {
resolutionStrategy.eachDependency { details ->
def requested = details.requested
if (requested.group == 'com.google.android.gms') {
details.useVersion '12.0.1'
}
if (requested.group == 'com.google.firebase') {
details.useVersion '12.0.1'
}
}
}
mavenLocal()
mavenCentral()
google()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
}

subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.android.support'
&& !details.requested.name.contains('multidex') ) {
details.useVersion "27.1.1"
}
}
}
}
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 16
compileSdkVersion = 28
targetSdkVersion = 28
supportLibVersion = "28.0.0"
googlePlayServicesVersion = "15.0.1"
androidMapsUtilsVersion = "0.5+"
}
project.ext {
excludeAppGlideModule = true
}

/*
task wrapper(type: Wrapper) {
gradleVersion = '4.7'
distributionUrl = distributionUrl.replace("bin", "all")
}
*/

最佳答案

我在google()中添加了build.gradle来解决此问题:

 buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.3'
}
}

allprojects {
repositories {
jcenter()
google()
}
}

关于android - React Native Android无法找到com.android.tools.build:gradle:3.6.3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61358760/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com