Intellij IDEA Project view doesn't show structure as it did before.

JavaIntellij Idea

Java Problem Overview


My directory structure in the Project seems to have disappeared. The first picture is the "bad". I recently upgraded to 12.1 and the vim emulator at about the same time. I don't know if I missed a dialog that reset something? I can't figure out how to get it back like the second picture.
I've tried to re-import the project but it has not helped. I keep the project on Dropbox and have another PC where I have not reloaded project. Is there a way to get my view from that machine?

![Bad][1] [1]: http://i.stack.imgur.com/Y4MLt.png


The picture is the "good" and how I want it to look.
![Good][2] [2]: http://i.stack.imgur.com/KEzMD.png

Java Solutions


Solution 1 - Java

I've come across this problem a few times myself. What happened is that intellij lost the module in my project settings. Here's my steps to fix it:

File -> Project Structure -> Click on modules (notice empty list) -> Click on '+' -> Click on import module -> Find existing myProj.iml

Solution 2 - Java

I also have quite a few IntelliJ projects and also git folders of text files. I found IntelliJ does not always reconstruct the .idea files correctly. However the following methods work for me.

  • Open IntelliJ in the top folder where there is no .idea folder. Often IntelliJ will just construct a new .idea folder and works.
  • Copy an .idea folder from a similar project and modify to fit. The xml files in the .idea are reasonable to modify.
  • Solution 3 - Java

    Open IntelliJ in the root project level works for me.

    I have a mixed project folder tree like the following:

    git_root
    - proj_android
    - proj_ios
    - proj_react
      - lib
      - src
    

    My problem is that when I open IntelliJ on my proj_react folder, I could not see my src folder or lib folder. (My proj_react is one level down from my git_root.)

    Then I open IntelliJ on git_root, I could see everything. The problem is solved.

    Solution 4 - Java

    If you are working on a software development project where you are using Maven, Gradle, Flash Builder etc., the below mentioned steps should restore the project structure:

    1. Ctrl+Alt+Shift+S (or) File>>Project Structure
    2. Select 'Modules' in 'Project Settings'
    3. Alt+Insert (or) Select '+' to add a new module
    4. Select 'Import Module'
    5. Select the folder you want to import the module from(Generally the parent folder)
    6. Select 'Import module from external model' and the corresponding external model

    This resets your project structure.

    Solution 5 - Java

    You can sometimes rescue projects like these by going and resetting their content root in the module settings. Or even recreate the module as another answer suggests.

    This is something that would happen to me if I opened an IntelliJ project in PhPStorm, then tried to open it in IntelliJ again.

    However as was mentioned the project format changed recently, so you should use the same version of intelliJ to work on your project.

    Solution 6 - Java

    If you have a content root for a project module that intersects with another content root, then this problem will occur. For example:

    Project A (content root)
        - source for A
    	- module B (content root)
    	  - source for B
    

    If you have a project that has a source root for "Project A" and you add a source root for "module B" you will end up with missing structure, such as your first picture. This happens because the content root for module B is within project A structure.

    This worked at one time, as I have the setup above with multiple modules. When I upgraded to 12.1.6 this stopped working. If you have overlapping source roots you will see this problem.

    I'm using 12.1.6 on windows 7.

    Solution 7 - Java

    On Mac:

    • Preferences

    • search for Project Structure or go directly to:

    • Project: Your_Project_Name / Project Structure

    • Mark all as Sources (mine was marked as "Excluded")

    Solution 8 - Java

    What did you update from? If you did a few major versions update, intellij really changed how their projects are laid out. You probably need to edit the projuct structure and add a new java module.

    Solution 9 - Java

    This issue is 8 years old and the problem still exists in IntelliJ. For projects with many modules, it can be a real pain reconstructing them after each time this occurs. I suggest that once you reconstruct the modules, back up the .idea folder so you can easily restore it next time

    Solution 10 - Java

    In the bottom left corner of IntellIJ you'll find an icon, using which you can fetch project structure, etc..,

    Solution 11 - Java

    This is the quick fix that i have done:

    1. Close the IDE and open the project folder in file manager
    2. Delete the .idea folder and reopen the project in IDE.

    To view the hidden folder and files:

    Open the folder and press cntrl+H (in linux), And in windows Go to folder options and check view hidden files option.

    Attributions

    All content for this solution is sourced from the original question on Stackoverflow.

    The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

    Content TypeOriginal AuthorOriginal Content on Stackoverflow
    QuestionGaryView Question on Stackoverflow
    Solution 1 - JavaSnellyBigodaView Answer on Stackoverflow
    Solution 2 - JavaLi LiView Answer on Stackoverflow
    Solution 3 - Javadavid m leeView Answer on Stackoverflow
    Solution 4 - JavaSatyaView Answer on Stackoverflow
    Solution 5 - JavasylvanaarView Answer on Stackoverflow
    Solution 6 - JavajmqView Answer on Stackoverflow
    Solution 7 - JavaA ShView Answer on Stackoverflow
    Solution 8 - JavaDaniel WilliamsView Answer on Stackoverflow
    Solution 9 - JavaKestyView Answer on Stackoverflow
    Solution 10 - JavaAbiView Answer on Stackoverflow
    Solution 11 - JavaMathew JohnView Answer on Stackoverflow