Could not find com.android.tools.build:gradle:4.3.3.

huangapple go评论96阅读模式
英文:

Could not find com.android.tools.build:gradle:4.3.3

问题

错误:

找不到 com.android.tools.build:gradle:4.3.3。
在以下位置查找:
  - 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
要求由:
    project :

build.gradle(Project):

// 顶级 build 文件,您可以在其中添加所有子项目/模块通用的配置选项。
buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath "com.android.tools.build:gradle:4.3.3"

        // 注意:不要在此处放置应用程序依赖项;它们属于各个模块的 build.gradle 文件中
    }
}

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

task clean(type: Delete) {
    delete rootProject.buildDir
}

build.gradle(app):

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'
}

这是在尝试连接到 Firebase 时出现的错误。(将 Firebase 添加到您的 Android 应用程序)
https://console.firebase.google.com

请注意,我已下载了 google-services.json 并同步了它,但仍然出现此错误。

英文:

Error :

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(Project):

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
}

build.gradle(app):

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'

}

This is while Trying to connect to fire base .(Add Firebase to your Android app)
https://console.firebase.google.com

Kindly help I have downloaded google-services.json and synced it as well and it gives this error.

答案1

得分: 6

版本 4.3.3 的 Android Gradle 插件不存在

请使用:

classpath "com.android.tools.build:gradle:4.0.1"

不要混淆它与 Google Play 服务插件:

classpath 'com.google.gms:google-services:4.3.3'
英文:

The version 4.3.3 of the android gradle plugin doesn't exist.

Use:

classpath "com.android.tools.build:gradle:4.0.1"

Don't confuse it with the google play services plugin:

classpath 'com.google.gms:google-services:4.3.3'

答案2

得分: 1

这个版本您正在尝试的版本不存在。

您可以在下面的链接中选择可用的备用版本。

https://jcenter.bintray.com/com/android/tools/build/gradle/

英文:

The version you are trying does not exist.

You can choose alternate versions available in the link below.

https://jcenter.bintray.com/com/android/tools/build/gradle/

答案3

得分: 1

如果您正在使用Android Studio 4.2(在我这里是Beta 3),而且这是一个React Native项目,它不会指向具有损坏的Gradle引用的gradle文件,因此您可能希望重新安装node_modules,以防您意外更改了它。

英文:

If you're using Android Studio 4.2 (Beta 3 in my case) and it's a react-native project, it won't point to the gradle file with the broken gradle reference, so you might want to re-install node_modules just in case you accidentally changed it.

huangapple
  • 本文由 发表于 2020年7月22日 18:52:38
  • 转载请务必保留本文链接:https://go.coder-hub.com/63032521.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定