2 options:
Another possible reason is: Google's maven repository is not set for the build script.
Open your project's main build.gradle add this line:
buildscript { repositories { google() <-- this // Be also sure that google() is before jcenter() } }Without this, it may not be able to download the Android Studio Gradle plugin 3.0+. It's not distributed in jCenter but in the Google's maven repository.
Run this command in root of project and resync project
rm .idea/libraries/Gradle__com_android_support_*.xml
del .idea\libraries\Gradle__com_android_support_*.xml