I got this error on Android Studio (AS):
How I got it:
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
Edit:
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.
Double check that under project structure / module / Manifest file it points to the correct manifest file in your code and not the one in generated sources.
This is true for both Android Studio and Intelli J. Sometime when you import project from existing sources it prefer the manifest file inside the generates sources directory.
What helped for me was:
Moving my
AndroidManifest.xml
toPROJECT_NAME/src/main
fixed the issue.In my case:
settings.gradle file was empty. I added defualt code:
Then I clicked
Then project start works.
I had the same errormessage and noticed I had 2 MYPROJECTNAME.iml files, but with a different casing of MYPROJECTNAME. I created this situation after checking out from SVN the project into a directory with the casing error. Just throw away the IML file with the wrong casing, after saving the content of both and use the content that works