AndroidManifest.xml file not found

2019-01-17 20:21发布

问题:

I'm using git, and creating lots of git branches for new features on a project I'm working on. Every once in a while, I'll create a new branch off master as usual (let's call this broken-branch, and this error appears:

Android Source Generator: [demo] AndroidManifest.xml file not found

I'll create a new branch off master, cherrypick the changes on broken-branch onto this one, and everything works fine. Why do I get this error, and how can I avoid it?

回答1:

This happened to me today.. I clicked "Sync Project with Gradle Files" and all went fine.



回答2:

While my IDE is IDEA13 with maven. Work fine with maven in command line, while using IDEA run( shift + F10) show this error. I do as below and fix this: 1.Open .iml in the project root.
2.Find some line like:

<option name="USE_CUSTOM_COMPILER_MANIFEST" value="true" />

3.Remove this line or change value to false. This is my work way.
May Help.



回答3:

I use IntelliJ Idea and found next solution: in the root of the project (in catalog with root build.gradle) create file settings.gradle which consist include ':app' Than go to IDE and run Gradle - refresh.



回答4:

I know the problem in IDEA because you create a new project with Java configuration (not android, but with android sdk dependency)

File > New Project > Java (Java Module) > Project SDK Android 4.X

Here is the solution :

File > New Project > Android (Application Module)


回答5:

If you are using Maven, backup the project and close it. Open IntelliJ and select Open..., choose the pom.xml file and then select yes to open this project. Because there is already a project a popup should appear, choose 'Delete Existing Project and Import'.

Note: I'm using IntelliJ Community Edition version 13



回答6:

It happens to me when I don't have .iml file to open the project. It's very easy to fix, you just need to close the project and reopen it taking care of select build.gradle file before click open.

I hope it helps somebody.



回答7:

When I get "AndroidManifest.xml file not found" error I clean and then refresh the project and these steps seem to fix the problem.



回答8:

This worked for me. My project already had a settings.gradle file. I simple had to add the line include ':app' . N ow i can build and do everything.



回答9:

open IDE

project

|--->build automatically

uncheck it clean the project

check build automatically opriot



回答10:

I just had this problem while trying to build the swagger code gen project. For whatever reason IntelliJ thought I should have an Android facet. Removing this facet allowed the entire project to build.