Just delete the method.
//DELETE THIS LINES:
android {
compileSdkVersion 21
buildToolsVersion '21.1.2'
}
Try to compile again. It should work now.
Source : https://medium.com/@marcuspereira/solving-the-gradle-dsl-method-not-found-android-in-android-studio-6e5ab499bd3#.u1lxecq41
Hi everyone for me it was a "couple days consuming job" to make my app run in Android Studio . Finally I found that very simple way of it .
That is all Enjoy it.
This worked for me:
<home folder>/.gradle
folder.P.S.: Mine was a fresh project so I removed the project as well and created a new one, so there were no old gradle references from the project
In my case, there are 2 build.gradle file in my project (it auto create by android studio when create new project)
Just move the compile line to another one is solve my problem