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/

查看最新版本是多少。


發佈了62 篇原創文章 · 獲贊 120 · 訪問量 32萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章