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

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

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

问题

错误:

  1. 找不到 com.android.tools.build:gradle:4.3.3
  2. 在以下位置查找:
  3. - https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.3.3/gradle-4.3.3.pom
  4. - https://jcenter.bintray.com/com/android/tools/build/gradle/4.3.3/gradle-4.3.3.pom
  5. - https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/4.3.3/gradle-4.3.3.pom
  6. 要求由:
  7. project :

build.gradle(Project):

  1. // 顶级 build 文件,您可以在其中添加所有子项目/模块通用的配置选项。
  2. buildscript {
  3. repositories {
  4. google()
  5. jcenter()
  6. }
  7. dependencies {
  8. classpath "com.android.tools.build:gradle:4.3.3"
  9. // 注意:不要在此处放置应用程序依赖项;它们属于各个模块的 build.gradle 文件中
  10. }
  11. }
  12. allprojects {
  13. repositories {
  14. google()
  15. jcenter()
  16. }
  17. }
  18. task clean(type: Delete) {
  19. delete rootProject.buildDir
  20. }

build.gradle(app):

  1. apply plugin: 'com.android.application'
  2. apply plugin: 'com.google.gms.google-services'
  3. android {
  4. compileSdkVersion 30
  5. buildToolsVersion "30.0.1"
  6. defaultConfig {
  7. applicationId "com.example.blogger"
  8. minSdkVersion 19
  9. targetSdkVersion 30
  10. versionCode 1
  11. versionName "1.0"
  12. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  13. }
  14. buildTypes {
  15. release {
  16. minifyEnabled false
  17. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  18. }
  19. }
  20. }
  21. dependencies {
  22. implementation fileTree(dir: "libs", include: ["*.jar"])
  23. implementation 'androidx.appcompat:appcompat:1.1.0'
  24. implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
  25. testImplementation 'junit:junit:4.12'
  26. androidTestImplementation 'androidx.test.ext:junit:1.1.1'
  27. androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
  28. }

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

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

英文:

Error :

  1. Could not find com.android.tools.build:gradle:4.3.3.
  2. Searched in the following locations:
  3. - https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.3.3/gradle-4.3.3.pom
  4. - https://jcenter.bintray.com/com/android/tools/build/gradle/4.3.3/gradle-4.3.3.pom
  5. - https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/4.3.3/gradle-4.3.3.pom
  6. Required by:
  7. project :

build.gradle(Project):

  1. buildscript {
  2. repositories {
  3. google()
  4. jcenter()
  5. }
  6. dependencies {
  7. classpath "com.android.tools.build:gradle:4.3.3"
  8. // NOTE: Do not place your application dependencies here; they belong
  9. // in the individual module build.gradle files
  10. }
  11. }
  12. allprojects {
  13. repositories {
  14. google()
  15. jcenter()
  16. }
  17. }
  18. task clean(type: Delete) {
  19. delete rootProject.buildDir
  20. }

build.gradle(app):

  1. apply plugin: 'com.android.application'
  2. apply plugin: 'com.google.gms.google-services'
  3. android {
  4. compileSdkVersion 30
  5. buildToolsVersion "30.0.1"
  6. defaultConfig {
  7. applicationId "com.example.blogger"
  8. minSdkVersion 19
  9. targetSdkVersion 30
  10. versionCode 1
  11. versionName "1.0"
  12. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  13. }
  14. buildTypes {
  15. release {
  16. minifyEnabled false
  17. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  18. }
  19. }
  20. }
  21. dependencies {
  22. implementation fileTree(dir: "libs", include: ["*.jar"])
  23. implementation 'androidx.appcompat:appcompat:1.1.0'
  24. implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
  25. testImplementation 'junit:junit:4.12'
  26. androidTestImplementation 'androidx.test.ext:junit:1.1.1'
  27. androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
  28. }

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 插件不存在

请使用:

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

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

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

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

Use:

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

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

  1. 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:

确定