511

I have an issue with IntelliJ. It doesn't show any folders in my project view on the left. My setting is "View As: Project" How can I manage it so that the folders and packages are shown again? I don't have any clue because I didn't change any options!

I'm using IntelliJ 10.0.3. I am working on a Maven Lift Project.

Kirby
  • 15,127
  • 10
  • 89
  • 104
Alex
  • 8,518
  • 4
  • 28
  • 40
  • So I'm working with Intellij version 14.1.5 and had a similar situation happen to me. I deleted all my project files (leaving just the idea folder), then fetched all code down fresh with git. Intellij didn't show any folders but did recognise the modules in project structure. I had to resolve all dependencies with maven, then open and close Intellij before the folders for all modules were shown in project view again. – Jeremy Jan 18 '16 at 12:03
  • 24
    i know there are solutions already provided. But this is how i got the issue in the first place. I was checking out the git project and before it finishes, opened the project in intellij. So the .idea folder was in a corrupt state and intellij does not refresh it automatically. Either you can delete the .idea folder and open again or try doing a synchronize. hope it helps. – pavan sachi Mar 10 '17 at 02:04
  • 2
    The same thing happened to me after I deleted the `.idea` folder – Jun Yin May 11 '18 at 14:58
  • 4
    IntelliJ Community 2018.1 - Simply deleting the entire .idea folder and then re-opening root folder from the IDE fixed this issue for me. IntelliJ rebuilt and reindexed the entire project. – S Walsh Jan 24 '19 at 20:41
  • 3
    I have remove git cloned folder. When I clone back my repository and open in IntelliJ it doesn't show the folders. So, after figure out I found `.idea` folder is missing `modules.xml` & `terrafuse.iml`. So, I copy this two files from `.idea` folder of another project and restarted the IntelliJ which in turn start working normally. – Moh Jun 28 '19 at 15:53
  • 1
    Still a bug in IntelliJ 2021.2 – Suzana Aug 02 '21 at 10:06
  • Try https://stackoverflow.com/questions/5816419/intellij-does-not-show-project-folders/69255837#answer-69255837 – Michael Pacheco Sep 20 '21 at 14:08
  • Small tip to JetBrains company - I had this issue around 6 times in 1 year. So I pretty sure when it happen. When for some reason Debugging process can not be finished correctly and connection stays open. After that you just close Idea -> and voila your .idea folder corrupted. – Novikov Apr 29 '22 at 07:39
  • delete the .idea folder, followed by a repair IDE, then Reopen the project (from the IDE repair) worked out for me. – Jackie Jul 19 '22 at 13:05

38 Answers38

536

I had to quit Intellij and remove the .idea folder (I stashed it first, just in case). I then re-opened the project and that worked for me. Don't forget to save your configuration (e.g. debug / run configurations) before that, because they will also be deleted.

CKey
  • 88
  • 5
isuPatches
  • 6,384
  • 2
  • 22
  • 30
505

So after asking another question, someone helped me figure out that under File > Project Structure > Modules, there's supposed to be stuff there. If it's empty (says "Nothing to show"), do the following:

  1. In File > Project Structure > Modules, click the "+" button,
  2. Press Enter (because weirdly it won't let me click on "New Module") step 2
  3. In the window that pops up, click on the "..." next button which takes you to the Content root. Find your root folder and select it step 3 part 1 step 3
  4. Click the "ok" button
  5. Ignore any warning that says the name is already in use
B T
  • 57,525
  • 34
  • 189
  • 207
  • 22
    I had to import a module – Pramod Setlur Jun 16 '15 at 23:08
  • 16
    This was 95% of the solution for me. I had to "Add Content Root" on that screen. Then for some reason all the folders magically appeared. – Lavamantis Jun 25 '15 at 20:39
  • 2
    This is something that has always bothered me, when you make a new project from existing source, everything works great. But when you make a new project, IDEA is constantly "this file isn't part of the project...". Now it all makes sense. – Jared Kipe Oct 10 '15 at 18:38
  • Had to select "java" and click on "next" in the 3rd step. – luckydonald Jun 02 '16 at 10:48
  • 7
    I can't believe how many times I have to do this with Intellij. Is there any way to get it to persist? I've got to be doing something contrary to Intellij's intent, because existing projects helpfully do this to me periodically. – enderland Aug 04 '16 at 18:17
  • making a new module worked but importing from the same folder worked just as well. – miva2 Apr 13 '17 at 11:25
  • Once you add a module you need to click on the "Source" tab select what you want to see in the IDE and mark it with the blue button "sources". – Anton Andreev Dec 01 '17 at 17:44
  • Because this is a asinine way to import files. – swade Jan 26 '18 at 18:58
  • what if it is doing this 100% of the time, even with projects you just created an hour ago with intellij? – roberto tomás Apr 29 '18 at 17:05
  • I had to reopen the project from the pom.xml and delete the existing project. – Marit Oct 14 '18 at 07:01
  • What about MVN project? Should I select the Maven instead of Java? – Čamo Apr 06 '21 at 09:57
  • There is no "folder structure" under file – Gulzar Mar 09 '22 at 12:35
75

I had this issue as well. It is something do with .idea just delete it and restart IntelliJ

RMati
  • 858
  • 7
  • 9
61

I went to FileProject StructureModules, clicked on + and then Import Module, found my root folder, selected it and it worked.

For IntelliJ 14.

Boris Verkhovskiy
  • 14,854
  • 11
  • 100
  • 103
Raghvendra Singh
  • 952
  • 9
  • 17
23

I am a new user of IntelliJ IDEA 2016.2. I opened an existing project when I first ran the program and had the same issue whereby it only showed files in the root directory in the 1. Project panel, but not the project folders (expandable tree-like structure).

Initially, I tried going to Project Settings > Modules, where no modules were shown listed. I clicked (+), and tried to select my root folder, but it wouldn't select the folder.

So I then solved it with these steps instead:

  • Exit IntelliJ
  • Delete the existing .idea folder (i.e. rm -rf .idea)
  • Restart IntelliJ
  • Verified that the project root folder now appeared (in Project Settings > Modules)
  • Toggle On the toolbar buttons (i.e. 1. Project Structure) to display on the left sidebar (clicked View > Toolbar Buttons until tick appears)
  • Click 1. Project Structure toolbar button until its sidebar is revealed
  • Click the arrow icon on the left of your project's root directory name that appears to expand the tree folder structure

UPDATE 2nd Sept 2017: If you've added a Module SDK and it added a .iml file within a subdirectory of the root of your project that causes it to load the module subdirectory, then it may be necessary for you to modify that .iml file by appending /.. as shown below.

  <component name="NewModuleRootManager" inherit-compiler-output="true">
    <exclude-output />
    <content url="file://$MODULE_DIR$/..">
Stuphan
  • 21
  • 7
Luke Schoen
  • 4,129
  • 2
  • 27
  • 25
23
  1. close intellij
  2. delete .idea folder
  3. restart intellij
  4. click import, select your project
  5. create project from existing sources, click next, next, next

And you should be good to go.

ionut
  • 727
  • 7
  • 8
21

A lot of answers here suggest deleting .idea. this works for me only about 50% of the time. A simple restart works about 10% of the time. Re-adding things as a module is a god-awful hack that causes other issues like losing some project-only settings.

I've also found this solution to work:

  1. File -> Repair IDE

enter image description here

  1. A dialog shows in the bottom right. Click "Rescan Project indexes"

enter image description here

  1. When the next dialog shows, click Reopen Project:

enter image description here

  1. Directories should show now.
aggregate1166877
  • 2,196
  • 23
  • 38
  • Problem is, this seems to not work wit Jetbrains Gateway in WSL. Repair Project just does nothing at all and the assistant won't launch – Marian Klühspies Feb 11 '23 at 10:05
  • @MarianKlühspies I have noticed that the problem gets far worse in slow Virtual Machines. I used to run this in a Linux Mint VirtualBox setup because the company I worked at refused native Linux installs. The more my host machine struggled, the more often this problem occurred. I got into the habit of immediately just cancelling project loading during startup, and then reopening. Seems to help quite a bit. Maybe try preventing auto-loading previous sessions, then selecting what you need from the recents list after the application boots. I'd be interested to know if that helps – aggregate1166877 Feb 12 '23 at 00:49
20
  1. You don't have to quit Intellij completely to make this work. Simply close the project that you have open. (You can open any another project to avoid closing it completely)

  2. Go to the directory where you have your project installed and delete the ".idea" folder.

  3. Reopen the Project.

That should fix it. It worked for me in May 2018.

Devner
  • 6,825
  • 11
  • 63
  • 104
19

Try to re-import the Maven project. Also make sure that the project directory name is not excluded in Settings | File Types | Ignore Files and Folders.

CrazyCoder
  • 389,263
  • 172
  • 990
  • 904
  • I have the same problem (seen it twice today on different projects). But removing all entries from the "Ignore Files and Folders" setting, doesn't help. What do you mean "re-import"? – B T Feb 06 '15 at 05:08
  • @BT try to delete `.idea` directory and create a new project on top of the existing files or import `pom.xml` if your project is Maven based. If the issue persists, please submit a ticket to the support team. – CrazyCoder Feb 06 '15 at 08:06
  • This happened to me - it's because I was switching branches and in this process I managed to exclude folders. – Knubo Oct 18 '17 at 11:18
11

I have deleted the .idea folder. Closed ItelliJ and restarted to open the same project.

It asked to add the content root. That worked for me.

11

Check out answer at

Can't see project folders in IntelliJ IDEA

It might be because the project didn't have any modules defined. Try adding existing source code by hitting File > New > Module from Existing Sources and select the parent directory of the project for source codeenter image description here

Harish Gokavarapu
  • 1,785
  • 17
  • 13
  • In case it is an Eclipse project you can also go to File -> Project Structure... -> Modules -> + -> Import Module -> go to your project root folder and select the .profile from Eclipse (you may need to click the "eye" icon to show hidden files). – Eric Sant'Anna Mar 10 '22 at 20:39
11

Deleting .idea/workspace.xml worked for me. Close the project, delete .idea/workspace.xml, and open the project again. I was using version 2019.1.

Samuli Pahaoja
  • 2,660
  • 3
  • 24
  • 32
10

Change the "Project" dropdown to be "Project Files"

IntelliJ Example

If the files still have a yellow highlighting behind them you may need to follow the #2 answer above (https://stackoverflow.com/a/28375299/3769076). The yellow highlighting indicates the files are not part of the project. You can remedy this by creating a module as explained in their answer.

solbs
  • 940
  • 3
  • 15
  • 29
  • This didn't work for me because Project Files shows all meta files as well, which is a messy workspace. – isherwood Jul 13 '22 at 13:13
9

I faced same issue when i deleted the .idea folder.

However, when I tried to invalidate and re-start, the .idea folder got created again but still the folders were not showing up.

I had to 1.close IntelliJ, 2.delete the .idea folder, 3.launch IntelliJ

This fixed the issue.

Anand
  • 183
  • 2
  • 7
9
  1. Backup the .idea folder into a zip file
  2. Delete .idea folder
  3. Reopen the project
  4. Close the project
  5. Extract backup files into the new fresh generated .idea folder
  6. Reopen the project
  7. Praise the sun ☀️ \[T]/
Michael Pacheco
  • 948
  • 1
  • 17
  • 25
9

I used the IDE Repair feature in WebStorm, without deleting .idea, in order to get the folders to show again.

enter image description here

Chris Sprague
  • 3,158
  • 33
  • 24
8

I have a better solution that worked for me and it might work for you. No need to delete the whole .idea folder as this way you lose the whole project. It is possible that you just accidentally excluded all folders in project settings. I also found that project folders disappeared. I was trying to find out how to disable indexing, so I was looking at Project Settings -> Modules and I clicked on Excluded to see if I could add the whole project there to ignore it for indexing. It didn't do anything and I couldn't drag and drop the folder under Excluded. What I didn't realize is that simply clicking "Excluded", IntelliJ automatically moves the folder to Excluded and all folders disappeared in Project Explorer. "Excluded" button changes background to gray, which means exclusion is active. This is a very poor user interface because it is hardly noticeable and clicking this button has a far-reaching impact on your project.

Fix:

  1. Open Project Settings -> Modules
  2. If Excluded is highlighted, click on it
  3. Click Apply or Close

Result: Folders in your project show up again

Really bad bad bad UI design! Source and Excluded buttons look like tabs when they work in fact as "Checkboxes"!

Be careful, just clicking Sources or Excluded seems like an innocent selection of tab without any visible effect, yet it has far-reaching consequences, basically adding or removing files from the build process.

Dezza
  • 1,094
  • 4
  • 22
  • 25
Robert
  • 81
  • 1
  • 2
  • This solution worked for me after the higher ranked answers did not. Seems like there is really more than one correct solution for this problem. – GideonleGrange Jan 04 '22 at 07:58
8

for me removing the .idea folder from the project directory worked.

Mohammed
  • 637
  • 13
  • 26
7

I have a nodeJs project and lost my folders after removing the /[project_name].iml file.

This restored the folders while preserving my other project settings:

  • Project Settings > Modules
  • + Add Content Root
Shanimal
  • 11,517
  • 7
  • 63
  • 76
4

Even after 5 years, and having some experience with idea, I still have this problem all the times. Here is the simplest solution.

  • Close Idea
  • Delete .idea
  • Start Idea and open project instead of import project

And then, open conf file for your framework, like pom.xml or build.sbt or build.gradle etc and it will automatically prompts to import project and when you click and when it finishes, your project is mostly setup correct.

RP-
  • 5,827
  • 2
  • 27
  • 46
  • but if you delete the .idea folder you loose all the project specific configurations – untore Jan 02 '17 at 15:35
  • Yes, we loose any specific project settings, but most of the module settings can be recovered if you open `pom.xml` or `build.sbt` and use import project feature. – RP- Jan 04 '17 at 17:30
3

I had the problem after an upgrade from intellij 15 (v143) to 2016.3 (v163). I also had an intermittent error on startup about a "Load error: undefined path variables" with a cryptic variable name.

After countless attempts at most solutions presented here (reimport the project, invalidate caches & restart, checks of project structure and paths...), the only thing that worked was to completely reinstall Intellij (removing the ~/.idea* ~/.IntellijIdea*) and selecting "No" at the question "would you like to migrate previous settings".

This finally worked.

mathieu
  • 2,330
  • 2
  • 24
  • 44
3

OS:Mac && IDE: IntelliJ && Project: Maven build

  1. Navigate to File>Project Structure>Modules.
  2. In right-hand area; list of modules would be present.
  3. Delete the default one selected and close IntelliJ.
  4. Next Open again; IntelliJ will ask if you want to treat the project as Maven project.
  5. Accept that popup and you are good to go.
2

Intellij imports the project after resolving all the dependencies. In my case, it was unable to resolve dependencies for some of the modules and was stuck there. I had to copy my Maven settings.xml from local repo to the default .m2 folder in order to point it to the correct local repo.

Kirby
  • 15,127
  • 10
  • 89
  • 104
Sarneet Kaur
  • 2,860
  • 1
  • 14
  • 12
2

Adding this answer for completeness. I was using 15.0.6 and had this problem. I trued to import a module from Maven or Gradle an it went through the process, but the module did not appear. I tried deleting the .idea file and restarting. Uninstalling and installing the latest version (community 2016.2) addressed the problem.

Francis Upton IV
  • 19,322
  • 3
  • 53
  • 57
2

Select the module settings and do these changes, it will work

In File > Project Structure > Modules, click the "+" button,

add new module as per your project specific like Java or RUBY or something then apply and ok

Jags
  • 111
  • 2
  • 7
2

As I had the same issue and none of the above worked for me, this is what I did! I know it is a grumpy solution but at least it finally worked! I am not sure why only this method worked. It should be some weird cache in my PC?

  1. I did close IntelliJ
  2. I did completely remove the .idea folder from my project
  3. I did move the folder demo-project to demo-project-temp
  4. I did create a new empty folder demo-project
  5. I did open this empty folder with intelliJ
  6. I did move all the content demo-project-temp. Don't forget to also move the hidden files
  7. Press right click "Synchronize" to your project
  8. You should see all the files and folders now!
  9. Now you can also safely remove the folder demo-project-temp. If you are on linux or MAC do it with rmdir demo-project-temp just to make sure that your folder is empty
John Skoumbourdis
  • 3,041
  • 28
  • 34
2

For me, it happens when i set Project SDK as JAVA SDK 14 in a react-native project. Upon unset, all the folders show up again.

Kudo
  • 328
  • 2
  • 8
  • Thank you! For me it turns out that WebOS SDK update (which included java) was the source of the problem. – crcerror Nov 12 '21 at 08:25
2

Deleting the .idea folder wasn't enough for me.

This seemed to originated from some git issue.

I had to

  1. Close PyCharm
  2. Add **/.idea to .gitignore
  3. Delete the .idea folder
  4. Open PyCharm
Gulzar
  • 23,452
  • 27
  • 113
  • 201
1

Project Structure => Modules => Select your module => Paths => Make sure "Inherit project compile output path" is selected

RoyalBigMack
  • 620
  • 7
  • 7
  • Could you please elaborate more your answer adding a little more description about the solution you provide? – abarisone Jun 08 '16 at 06:52
1

I just had the same problem with an SBT project in IntelliJ 2016.2 after removing a globally installed IntelliJ and re-installing in my own home folder (Linux). No files or folders were shown in Project View anymore.

The Project Structure view wouldn't even open, and renaming the .idea folder to .idea.bak and re-importing the project didn't make any difference.

However, what fixed it for me was to reboot Linux. Afterwards it worked again, even with the original .idea folder. Seems this "fix" is not only restricted to the Windows world.

Daniel Werner
  • 1,350
  • 16
  • 26
1

If you have a gradle module with the same name as your projects root folder, the gradle import will replace your toplevel module configuration and change your view completely.

Make sure you have no gradle module with the same name as your root directory.

chris
  • 2,467
  • 2
  • 25
  • 25
1

I encountered this problem when the .idea folder was accidentally added to SVN version control. When I took an update --- blooey! I subsequently removed the .idea folder from version control.

Big Al
  • 980
  • 1
  • 8
  • 20
1

I tried all the solutions above, nothing worked.


Java-Maven project

My problem: In my case i had java-maven project. And the problem was that Idea by default uses it's bundled maven for projects(or anyone you trying to open). I noticed that bundled maven keeps downloading dependencies forever, i.e you never see your sources folder.

Solution: So to configure that, one needs to configure Idea to use maven(mvn) which is installed on the machine for all projects by default. To do that, in the beginning when Idea still did not open any projects...there is a configure button. There chose build tools. Then maven, there you will see dropdown list where you can choose local maven. In short: Configure/Build Tools/Maven/DropdownMenu (My OS: linux branch)

Hope that helps

rone
  • 67
  • 1
  • 7
1

I have that little while earlier and solved it by following the steps provided below:

  1. Right-click on the External Libraries and select the Load/ Unload modules button

enter image description here

  1. If you see the modules are already loaded, perform the unload/load again as this happens due to a bug in the IntelliJ.

enter image description here

After I have done that, I see the project again at the top of the External Libraries section.

Arefe
  • 11,321
  • 18
  • 114
  • 168
1

For me in IntelliJ it was showing me a popup to import the existing project as gradle project. I just clicked ok on it and then the folder structure appeared properly.

Pukhraj soni
  • 1,832
  • 2
  • 17
  • 11
1

When importing your project/module be sure to check these two boxes:

enter image description here

Miner_Glitch
  • 537
  • 4
  • 16
1

If you're trying to open a scala/sbt project, the sbt version set in /project/build.properties must match the sbt version installed on your system or intellij won't detect your project's modules properly.

Once that's done, you can just delete the idea folder and restart as the other answers suggest.

0x6C38
  • 6,796
  • 4
  • 35
  • 47
0
  1. Disable all plugins
  2. Restart IDE
  3. Files and folders should now be visible
  4. Go through your plugins 1 by 1 enabling them to find the culprit
Savlon
  • 744
  • 2
  • 11
  • 18