Android Studio: Android Manifest doesn't exists or has incorrect root tag

AndroidIntellij IdeaGradleAndroid Studio

Android Problem Overview


I got this error on Android Studio (AS): enter image description here

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.

Android Solutions


Solution 1 - Android

On Android Studio v0.8.2 clicking on Sync project with Gradle files button solved my problem.

Screenshot of Android Studio toolbar with

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.

Solution 2 - Android

Just call (in any case) File -> Invalidate Caches and Restart....

Solution 3 - Android

In my case:

settings.gradle file was empty. I added defualt code:

include ':app'

Then I clicked

Sync Project with Gradle Files

Then project start works.

Solution 4 - Android

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.

Solution 5 - Android

What helped for me was:

  • delete .gradle/ folder
  • delete .idea/ folder
  • delete *.idea file
  • reopen Android Studio
  • import from gradle as Android Studio then suggests

Solution 6 - Android

I ran into a similar problem. Looks like my .../src directory for whatever reason moved under my .../lib directory. I moved it out of the /lib directory. Now both /lib and /src are at the same level. After a couple of clean rebuilds and restarts of Android studio everything is back to normal. My emulator started up fine.

You might want to check your directory structure. Compare the directory structure with a working project. You might be able to see the difference.

Solution 7 - Android

Moving my AndroidManifest.xml to PROJECT_NAME/src/main fixed the issue.

Solution 8 - Android

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

Solution 9 - Android

I had this problem with a multi-module project when I renamed the app module. In my case to solve the problem I had to manually update the app module name in the project's settings.gradle file (Android Studio didn't update that value)

Solution 10 - Android

Happened to me. Found that i had wrongly opened the parent folder of the actual project in Android Studio.

Solution 11 - Android

In my case, it was my AndroidManifest.xml file, it was all messed up due to a new library that I added in my build.gradle. So I took the AndroidManifest.xml from my latest commit on Git and I replaced it the current one, and also my settings.gradle was empty so I added include ':app'.

Hope it helps, and happy coding !

Solution 12 - Android

Facing same issue, resolve after adding the missing build.gradle file in root project.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionPaschalisView Question on Stackoverflow
Solution 1 - AndroidaxierjhtjzView Answer on Stackoverflow
Solution 2 - Androidarmansimonyan13View Answer on Stackoverflow
Solution 3 - AndroidEliasz KubalaView Answer on Stackoverflow
Solution 4 - Androiduser1777591View Answer on Stackoverflow
Solution 5 - AndroidOstkontentitanView Answer on Stackoverflow
Solution 6 - AndroidnewAndroidDeveloperView Answer on Stackoverflow
Solution 7 - AndroidDanpeView Answer on Stackoverflow
Solution 8 - Androiduser1536307View Answer on Stackoverflow
Solution 9 - AndroidDiego PalomarView Answer on Stackoverflow
Solution 10 - AndroidMithilesh GuptaView Answer on Stackoverflow
Solution 11 - AndroidWassim Ben HamoudaView Answer on Stackoverflow
Solution 12 - AndroidLalit GoswamiView Answer on Stackoverflow