Android Studio: Android Manifest doesn't exist

2019-01-07 06:32发布

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.

11条回答
在下西门庆
2楼-- · 2019-01-07 07:13

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.

查看更多
SAY GOODBYE
3楼-- · 2019-01-07 07:18

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
查看更多
相关推荐>>
4楼-- · 2019-01-07 07:20

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

查看更多
淡お忘
5楼-- · 2019-01-07 07:23

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.

查看更多
Emotional °昔
6楼-- · 2019-01-07 07:24

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

查看更多
登录 后发表回答