Possible reason: your project has only one build.gradle
Solution steps:
1. Add in build.gradle
buildscript { repositories { jcenter () maven { url "https://maven.google.com" } } dependencies { classpath 'com.android.tools.build:gradle:3.0.1' } }
2. Download and use the support package jar and put it in the libs folder of the project
dependencies { compile files ('libs/android-support-v4.jar') }