1. Problems
I upgraded the latest version of Android studio today, and then Android studio asked me if I wanted to upgrade both the gradle plugin and Gradle of the project to the latest version, saying that it can maximize the use of Android studio functions, so I thought I would upgrade. . . Then leakcanary can't sync (Gradle sync failed), and it keeps making me change dependencies.
2. Solution
Just roll back the gradle plugin and Gradle to the previous version number, I am going back to
This depends on what gradle plugin and Gradle version the third library depends on, you can refer to the build.gradle of the third library (for example: click to open the link )
For example leakcanary:
dependencies { classpath 'com.android.tools.build:gradle:3.0.1' classpath 'net.ltgt.gradle:gradle-errorprone-plugin:0.0.13' classpath 'com.github.ben-manes:gradle-versions-plugin:0.17.0' }