可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
With my last restart of my mac I had a problem with IntelliJ IDEA project : the .iml file was deleted and I have
Error loading project: cannot load module cars-service Details ....
in the console.
Besides that, the structure view of the project has disapeared. Here is a screenshot:
回答1:
Finally, I imported my project via import project so the iml file was recreated.
回答2:
This happened to me this morning*, and fortunately there's a fairly straightforward solution.
- Press
Ctrl+Alt+Shift+S
(or go to File > Project Structure...
) and click Modules
on the left of the window. - Click the green
+
above the list of modules then New Module
. Select the type of module (Java, Android, Flash, what have you) and click Next
. - Enter the details of the lost module. Click the browse button to the right of Content Root and navigate to the directory that contains your lost module. The module name will be populated with the directory name by default, but you can rename it without issue.
(*I... got a bit gung-ho with the old git clean -fd
. I don't recommend it.)
回答3:
The error has nothing to do with gems. Please try deleting the .idea directory and using "Open Directory" on the same directory again to recreate it.-- Dmitry Jemerov
↑an answer on intellij-support.jetbrains.com
This helped me. I just closed Pycharm, then delete .idea directory , then I open Pycharm again, and the error disappeared.
回答4:
Please try File -> Invalidate Caches / Restart ...
回答5:
IML file is necessary to load the project.
Locate the folder the .iml file used to be in > right click > Local history > show history.From there you should be able to restore that iml file
回答6:
Had a similar issue with PHPStorm (which is also idea based), caused by a renaming of my project. Solution was simple: I just needed to remove the corresponding line for the module declaration in file <project-directory>/.idea/modules.xml
. Re-opening the project was not needed as it seemed to me, but I did it anyway.
Have had this issue with PHPStorm 2017.1.3.
回答7:
Closing intelliJ. Deleting the .idea folder and re-opening intellij worked for me.
回答8:
I had the same issue today. IntelliJ IDEA 2017.1.2 was complaining about one module I had refactored it's name from let's say "module-a" to "module-b". Apparently, IDEA was expecting the IML file with the old name (module-a.iml), thus had always this annoying warning on startup.
What I did and worked for me is to manually create right next to the new "module-b.iml" file in the file system the "module-a.iml" file as well. A fake one, I cloned "module-b.iml" to "module-a.iml". The warning disappeared.
Finally, I deleted the useless file "module-a.iml" from within IDEA. In the next startup I received no warnings.