I got this error on Android Studio (AS):
I created an AS Project from scratch and everything was fine.
Then a popup showed up, and (if I recall correctly) was saying something like: "Android Framework detected
". I pressed "Yes' and some changes happened to the project/module. And after that I got the above error
In my case the problem was not Gradle
related. It had to do with IntelliJ
/Android Studio
configuration, an .iml
file in particular.
I realized that after reading this informative post here.
On Android Studio v0.8.2 clicking on Sync project with Gradle files
button solved my problem.
update
Thanks to the comment of jaumard. If the Sync project with Gradle files
it's not visible you have to open the Gradle panel and click sync icon on top the toolbar.
Hope it helps :)