java - 找不到 com.android.tools.build:gradle:4.3.3
问题描述
错误 :
Could not find com.android.tools.build:gradle:4.3.3.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.3.3/gradle-4.3.3.pom
- https://jcenter.bintray.com/com/android/tools/build/gradle/4.3.3/gradle-4.3.3.pom
- https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/4.3.3/gradle-4.3.3.pom
Required by:
project :
build.gradle(项目):
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.3.3"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
构建.gradle(应用程序):
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 30
buildToolsVersion "30.0.1"
defaultConfig {
applicationId "com.example.blogger"
minSdkVersion 19
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
这是在尝试连接到 fire base 时。(将 Firebase 添加到您的 Android 应用程序) https://console.firebase.google.com
请帮助我下载了 google-services.json 并同步了它,它给出了这个错误。
解决方案
4.3.3
android gradle 插件的版本不存在。
利用:
classpath "com.android.tools.build:gradle:4.0.1"
不要将它与 google play services 插件混淆:
classpath 'com.google.gms:google-services:4.3.3'
推荐阅读
- asp.net-core - 在 IIS Express 上具有属性路由的 ASP.Net 核心在发布时会出现 503 错误
- apache-camel - Apache Camel Mail 组件接收器示例不起作用
- django - 了解 django 注释
- r - 如何根据另一列的条件在列中应用操作
- r - 如何在后端使用 Impala 连接修复 dbWriteTable“错误:无法取消引用 dbo.test_cars”?
- libgdx - 如何将 3d 模型从搅拌机加载到最新版本的 LibGDX?
- excel - VBA代码搜索下一个非空单元格的列,向上移动1个单元格并将某些内容粘贴到其中..直到完成
- go - 在 Alpine 中找不到 runtime/cgo
- ios - 获取 JSON 数据并将其解析为使用 Decodables。但我收到一些错误“无法读取数据,因为它的格式不正确”
- scala - Spark 中 Vectors.dense 数组中的数组