且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

错误:(1, 0) 未找到 ID 为“com.android.application"的插件

更新时间:2023-11-16 13:41:16

更新答案(2020 年 12 月 2 日)

最新 Gradle: 6.5

版本检查:

  • ./gradlew -v

如何更新:

  • 设置网址:./gradlew wrapper --gradle-version=6.5 --distribution-type=all
  • 更新:./gradlew 包装器

最新的 Android Gradle 插件: 4.1.0

如果您将以下代码片段添加到 build.gradle 文件的顶部.Gradle 将更新构建工具.

If you add the following code snippet to the top of your build.gradle file. Gradle will update the build tools.

buildscript {
    repositories {
        google() // For Gradle 4.0+
        maven { url 'https://maven.google.com' } // For Gradle < 4.0
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:4.1.0'
    }
}

在此处阅读更多信息:https://developer.android.com/studio/build/index.html 以及这里的版本兼容性:https://developer.android.com/studio/releases/gradle-plugin.html#updating-gradlehttps://dl.google.com/dl/android/maven2/index.html.

Read more here: https://developer.android.com/studio/build/index.html and about version compatibility here: https://developer.android.com/studio/releases/gradle-plugin.html#updating-gradle and https://dl.google.com/dl/android/maven2/index.html.

我遇到了同样的错误,您需要确保您的 Gradle 版本与您的 Android Gradle 插件兼容.

I had this same error, you need to make sure your Gradle version is compatible with your Android Gradle Plugin.

最新版本的 Gradle 是 2.0,但您需要使用 1.12 才能使用 Android Gradle 插件.

The latest version of Gradle is 2.0 but you need to use 1.12 in order to use the Android Gradle Plugin.