Error:(1, 0) Gradle DSL method not found: 'android()'

I just ran into this same error. Make sure you don't have an android block in the top-level build.gradle for the project, only in the module's build.gradle file.

This happened to me when AndroidStudio tried to import and existing, buildable Eclipse/ADT project–I had to cut and paste the android block from one gradle file to the other. I don't know if this has been fixed in more recent versions of AndroidStudio.


I ran into the same problem. My fix was adding "apply plugin: 'android'" before android block... Hope it helps anyone.


Inspired by Ionoclast Brigham's answer I've checked both gradle files. I had android() in both of them... but instead of moving android() from the root one to module one I've just added

apply plugin: 'android'

to root one and build works fine.