the Android gradle plugin version xxx is too old please update to the lateset version

在这里查看插件和 gradle 版本的对应关系:

  1. https://developer.android.google.cn/studio/releases/gradle-plugin
  2. https://devloper.android.com/studio/releases/gradle-plugin

然后注意 build.gradle 里面的 classpath 应该这样写,Android Studio 会自动下载新版本。

    buildscript {
        repositories {
            // Gradle 4.1 and higher include support for Google's Maven repo using
            // the google() method. And you need to include this repo to download
            // Android Gradle plugin 3.0.0 or higher.
            google() // 注意这一行!!!
            mavenCentral() // 这行也是需要的!!
            ...
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:3.4.0' // 修改这个版本
        }
    }

然后修改 gradle-wrapper.properties 文件,把

distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-all.zip

修改为对应的最新 gradle 版本 gradle-5.1.1-all.zip

本地路径为

C:\Program Files\Android\Android Studio\gradle\m2repository\com\android\tools\build\gradle

以下方法已过时


访问:http://jcenter.bintray.com/com/android/tools/build/builder/

查看最新版本是多少。


猜你喜欢

转载自blog.csdn.net/kencaber/article/details/103816796