Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio missing src folder

I was working on an android application which was imported from a git repo. Recently, I noticed that the application when opened from Studio does not show src folder. All files that were in src have been transferred to the Project folder and the Manifest.xml has been sent to jar files which makes it impossible for me to read/edit it. When I checked from command, the src folder and manifest file (etc.) were in their correct places. The repo also has everything in order. I am able to open the manifest file via vim (and edit it too!) Just not from Android studio.

Does anyone have any idea what may be wrong? I've already updates my studio and that did not solve the issue.

like image 902
javaProgrammer Avatar asked Apr 01 '14 17:04

javaProgrammer


People also ask

What is src folder in Android Studio?

src/ folder which holds the Java source code for the application. lib/ folder which holds extra jar files required at runtime, if any. assets/ folder which holds other static files you wish packaged with the application for deployment onto the device. gen/ folder holds source code that Android's build tools generate.

Do we need src folder?

The /src folder is used to store the file with the primary purpose of reading (and/or editing) the code. The /src folder contains all the sources, i.e. the code which is required to be manipulated before it can be used.

What is src file in Android?

src - Java source files associated with your project. This includes the Activity "controller" files as well as your models and helpers. res - Resource files associated with your project. All graphics, strings, layouts, and other resource files are stored in the resource file hierarchy under the res directory.

What contains src folder?

The source folder is named src . It contains the Java code of the application.


3 Answers

In the upper-left corner of the Project tool window is a dropdown menu that lets you choose between "Project" and "Packages", among other things. Change it to "Project".

Screenshot of menu in Project tool window

like image 55
Scott Barta Avatar answered Oct 16 '22 22:10

Scott Barta


Follow what Scott Barta said, but instead of Packages I seletected Project and expanded the entries and I was able to see app/src.

like image 30
Dula Avatar answered Oct 16 '22 20:10

Dula


Under the project directory, you should see

  • Your project name (e.g. Hello World)
  • External Libraries

When you expand your project, you'll see a few folders:

  • Idea
  • app
  • Gradle
  • ...

The 'src' folder is within that 'app' directory.

like image 3
mit Avatar answered Oct 16 '22 21:10

mit