This question's answer In build.gradle change position of google() and place it first:
This is how it was before, if you don't have google() add it as the first one in the buildscript:
buildscript {
repositories {
jcenter()
google()
}
change to,
buildscript {
repositories {
google()
jcenter()
}