When compiling some old projects, the versions of gradle and Android gradle plugins have always been updated due to problems, and there are always various errors, coupled with domestic network speed, and various uncomfortable. In view of the fact that various information on the Internet is out of date, I will update the record here, and it will be easy to handle when it is used in the future. Mainly build.gradle file and gradle-wrapper.properties file, modify the version of gradle plug-in and gradle in these two files to enter the next step.
For example, your gradle version is 5.4.1. The
gradle-wrapper.properties file is:
distributionUrl = https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
Looking at the above table, we can see that the version of the gradle compilation plugin that needs to be set in build.gradle is 3.5.0 or higher.
buildscript {
repositories {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.2'
}
}