I'm trying to upgrade my android support libraries to the latest versions, eg.
dependencies {
...
compile 'com.android.support:design:26.0.0'
}
However, when I run the gradle sync, these libraries cannot be resolved:
Error:(30, 13) Failed to resolve: com.android.support:design:26.0.0
Install Repository and sync project
Show in File
Show in Project Structure dialog
Clicking "Install Repository and sync project" does nothing.
This SO answer suggests it might be due to not having the google()
repository in my build.gradle. However, if I add it and try to sync, I get "Gradle DSL method not found: 'google()'. It lists possible causes:
- The project 'xyz' may be using a version of the Android Gradle plug-in that does not contain the method (e.g. 'testCompile' was added in 1.1.0). Upgrade plugin to version 2.3.3 and sync project <= I am using "classpath 'com.android.tools.build:gradle:2.3.3'"
- The project 'xyz' may be using a version of Gradle that does not contain the method. Open Gradle wrapper file. <= using gradle 3.3
- The build file may be missing a Gradle plugin. Apply Gradle plugin. <= Again, the gradle plugin is listed in the dependencies of the build file.
How can I upgrade to the latest Android support libraries?