Chintan Rathod
Chintan Rathod

Reputation: 26034

Android Studio "Project Structure" not coming properly

I follow all the necessary steps for Android Studio installation. I also checked this question, but still facing the same issue.

But whenever I create any new project, following screen come. I couldn't found any project structure as I can see in Eclipse.

enter image description here

Here, I can't find any "src","res" or any file structure. Any idea, how to get proper Project Structure?

when I tried to add "New Module" following error comes to submit.

No message
java.lang.IllegalStateException: 
at com.android.tools.idea.wizard.NewModuleWizard.onFailure(NewModuleWizard.java:159)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3.execute(ExternalSystemUtil.java:340)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$4$1.run(ExternalSystemUtil.java:364)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$TaskRunnable.run(ProgressManagerImpl.java:493)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$6.run(ProgressManagerImpl.java:304)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressManagerImpl.java:185)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:226)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:175)
at com.intellij.openapi.application.impl.ApplicationImpl$10$1.run(ApplicationImpl.java:695)
at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:458)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:154)

When I go to Edit Configuration, can't create any module due to above error.

enter image description here

Upvotes: 56

Views: 73329

Answers (13)

Syl.H
Syl.H

Reputation: 259

Got the problem with the latest version of Mac and latest version of Android studio (I'm writing this in July 2024).

It appears that it was because I created my project on the desktop, because when I create them in my documents folder I don't have the problem.

Upvotes: 0

Muhammad Mubeen
Muhammad Mubeen

Reputation: 153

simple way to restore

Delete the project hidden .idea file and .gradle file and restart your project this will fix your issue.

Upvotes: 2

蔡宗容
蔡宗容

Reputation: 1047

Before:

  enter image description here

After:

  enter image description here
  I got the java folder (src folder) and others.

Solution:

  enter image description here

  • File > Sync Project with Gradle Files

Android Studio Version: 3.2.1

Note: This case did not appear on the old version. For example, 1.5.1 (2016/03 before)

Keywords:

  • file explorer
  • file structure
  • file hierarchy
  • file system
  • folder & file list
  • project explorer
  • project structure
  • project hierarchy
  • disappear / gone / did not see
  • Android Studio bug / issue

Upvotes: 2

Badr Bujbara
Badr Bujbara

Reputation: 8671

I deleted the app from the list of apps when you open Android Studio, then I reimported the project.

Upvotes: 1

Tom Rutchik
Tom Rutchik

Reputation: 1692

Kip2's solution worked for me with a slight variation:

1.) File -> Invalidate Cached/Restart..

once android studio restarts:

2.) File -> Sync Project with Gradle Files


Just doing "File -> Sync Project with Gradle Files" (or doing "File -> Sync with File System"), did not correct the problem. I had to invalid the cache first, and then sync the project with gradle files for the project to display properly.

Upvotes: 5

J D
J D

Reputation: 284

In Android Studio 2.3.1, you don't have the Application module option if you wanted to add a module. The best solution is to right click your project and select "Jump to the source" from the menu. That solved my issue.

Upvotes: 0

Dream in the wind
Dream in the wind

Reputation: 79

For Android Studio 2.2, you can simply click the left bottom and then select Project

enter image description here

Upvotes: 0

Eren Yilmaz
Eren Yilmaz

Reputation: 1150

Also, make sure that the root iml file matches case with your root folder. Incorrectly named iml file will cause such problems.

Just delete the root iml file (you can backup if you like), close the project and re-open it. Android Studio will generate the correct iml file and the project structure will be restored.

This is tested on Android Studio 2.1

Upvotes: 2

Maddy
Maddy

Reputation: 586

Go to File > Project Structure > Project Settings > Modules.

Click on the green colored + and add new module. select Application module and set the content root to your project module.

Click next and then finish.

This should do the trick and the complete project structure will appear. It worked for me.

Upvotes: 57

Mr.Moustard
Mr.Moustard

Reputation: 1307

When something like that happens to me, to fix it, I go to

File -> Project Structure -> Modules, click (+) to add a module.

To import the main module you have to search for the IML extension file to load the project structure configuration again (for example app.iml), and thats all. I hope it helps.

Upvotes: 9

kip2
kip2

Reputation: 6863

Modules or the project structure could also not appear because you're in a branch where *.iml files are missing. This happened for me when I was migrating from Eclipse and had decided to check back into the original branch that had the Eclipse-like project structure. What solved my problem:

  1. Checkout the branch with Android Studio-like project structure
  2. File -> Invalidate Cache & Restart

Upvotes: 3

theblang
theblang

Reputation: 10425

Change the SDK to a level that you have installed in the SDK manager. The SDK manager can be accessed from Tools -> Android -> SDK Manager. For me, Android Studio was packaged with API Level 17 but the new project wizard tried to target API Level 18.

Upvotes: 9

Chintan Rathod
Chintan Rathod

Reputation: 26034

Finally find solution.

Whenever Android Studio starts, it search for "Gradle" installation. If not found, it will download new version of it and cache it here.

C:\Documents and Settings\user\.gradle\wrapper\dists\gradle-1.6-bin\72srdo3a5eb3bic159kar72vok

Here 72srdo3a5eb3bic159kar72vok directory name may be different.

What you need to do is, download gradle-1.6-bin.zip, place it in above directory. Then decompress it there. But make sure your path should like below.

C:\Documents and Settings\crathod.SOLUSOFTINDIA\.gradle\wrapper\dists\gradle-1.6-bin\72srdo3a5eb3bic159kar72vok\gradle-1.6\bin

Now, when you restart your Android Studio, Gradle will be initialized and Project will opened in Full Project Structure.

Upvotes: 3

Related Questions