简体   繁体   English

Android Studio 未找到 AndroidManifest.xml

[英]Android Studio not found AndroidManifest.xml

I'm using the Android Studio v0.2.x.我正在使用 Android Studio v0.2.x。

I just created a new application with default settings: File -> New Project -> ... , then step by step.我刚刚使用默认设置创建了一个新应用程序: File -> New Project -> ... ,然后逐步进行。

When I built it, it failed.当我建造它时,它失败了。 The log is:日志是:

Android Source Generator: [MyApplication] AndroidManifest.xml file not found Android 源代码生成器:[MyApplication] AndroidManifest.xml 文件未找到

But I have checked the source.但我已经检查了来源。 It has the AndroidManifest.xml file.它有AndroidManifest.xml文件。 Any idea what causes this?知道是什么原因造成的吗?

I solved the problem by re-importing the project.我通过重新导入项目解决了这个问题。 By doing so, Android Studio will re-generate the .iml files.通过这样做,Android Studio 将重新生成 .iml 文件。

You can configure the location of the manifest file like this:您可以像这样配置清单文件的位置:

  1. open the Project Structure dialog打开项目结构对话框
  2. go to "Modules" (in the left tree)转到“模块”(在左侧树中)
  3. select "Android" in the middle column of the dialog在对话框的中间栏中选择“Android”
  4. Now you see on the right side a list of files where you can pick the Manifest file.现在您会在右侧看到一个文件列表,您可以在其中选择 Manifest 文件。

尝试清理项目,然后刷新并再次尝试构建。

Project -> Clean

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM