(18) Android studio cannot sync third-party libraries normally after upgrading

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'
}


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325852362&siteId=291194637