简体   繁体   English

android studio没有生成iml文件?

[英]android studio not generating iml file?

hi i am android developer and i am getting some problem, usually i do not care about.iml file in project folder but my senior said me that i do not have.iml file in my project.嗨,我是 android 开发人员,我遇到了一些问题,通常我不关心项目文件夹中的 .iml 文件,但我的前辈说我的项目中没有 .iml 文件。 i do not know what the usage of.iml file and how to use it.我不知道.iml文件的用途和使用方法。

but the main thing is that android studio is not generating.iml file for my any project.但主要是 android 工作室没有为我的任何项目生成.iml 文件。 for example in other developers project, if project name is apple than there would be apple.iml in project folder but it is not happening in my case.例如,在其他开发人员项目中,如果项目名称是 apple,则项目文件夹中将有 apple.iml,但在我的情况下并没有发生。 i have also updated my Android Studio in hope that it would get fix but it didn't.我还更新了我的 Android Studio,希望它能得到修复,但它没有。

well, please help me how to fix this problem and also tell me what is the usage of.iml file in android projects好吧,请帮我解决这个问题,并告诉我android项目中.iml文件的用途是什么

IML is a module file created by IntelliJ IDEA, an IDE used to develop Java applications. IML 是 IntelliJ IDEA 创建的一个模块文件,一个 IDE 用于开发 Java 应用程序。 It stores information about a development module, which may be a Java, Plugin, Android, or Maven component;它存储有关开发模块的信息,可能是 Java、Plugin、Android 或 Maven 组件; saves the module paths, dependencies, and other settings.保存模块路径、依赖项和其他设置。

In case if an.iml file is not generated on your project, there are two ways to do that,如果您的项目中没有生成一个 .iml 文件,有两种方法可以做到这一点,

First:第一的:

  1. Go to Android Studio and open your project. Go 到 Android Studio 并打开您的项目。
  2. Go to Files Go 转文件
  3. Select Sync Project with Gradle Files Select 与 Gradle 文件同步项目

Second:第二:

  1. Close your Android Studio关闭您的 Android 工作室
  2. Go to your root project directory Go 到你的项目根目录
  3. Delete the.idea folder.删除 .idea 文件夹。 If not visible you can check the hidden folders如果不可见,您可以检查隐藏文件夹
  4. Import the same project again.再次导入相同的项目。

This should re-generate your.iml files这应该重新生成 your.iml 文件

To generate a new .iml file生成新的.iml文件

  1. You have to delete all the folder starting with the dot(.) like .idea , .dart_tool and pubspec.lock file您必须删除所有以点(。)开头的文件夹,例如.idea.dart_toolpubspec.lock文件

  2. The project folder name should be all lowercase, with underscores to separate words, just_like_this .项目文件夹名称应全部小写,用下划线分隔单词, just_like_this

  3. Open your project in the Android Studio from terminal run this command flutter create --platforms=android.从终端运行此命令flutter create --platforms=android.

  4. This will generate just_like_this.iml file for you.这将为您生成just_like_this.iml文件。 If your package name is different then delete a new directory generated in your project file if needed.如果您的 package 名称不同,则根据需要删除项目文件中生成的新目录。

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

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