I got this problem when I updated the Gradle plugin from version 1.2.3 to 1.5.0 as Android Studio suggested. In its web page, 1.5.0 appears to be a beta version.
Honestly, I don't know what advantages the version 1.5.0 has, but I'd rather wait until there's a stable version.
Of course, going back to 1.2.3 solved the issue.