Why is my android studio 4.0 project structure different? - android

I have updated my android studio to version 4.0 and the project structure has changed somehow. I am new to android developing so I can't tell the changes but the folders are red.
Why are they red? Is it an error or am I doing something wrong?
Here is the project structure:

Everything is ok. It's "non-project" files and folders. build is generated folder. .gradle is generated too and contains some files used by Gradle.
You can change the project structure view to e.g. Android. In this case, these folders will be hidden.

Related

why is the "app" folder missing from my android studio 3.5.3

I'm new to the android studio. I made a new project, with these options:
1- language= java
2- for phone or tablets
3- empty activity / no activity
but the folders in my project are completely different from everyone else.
.
why is this happening to my project? why I don't have Java, manifest, build.gradle (module:app) and ... folders in my project?
In project section may you left side android icon and
right side setting icon
do:-
click on setting icon ,hence you can see Compact middle package, select this.
your gradle is not build successfully.
rebuild project. see gradle problem, and fix it for solve project structure.
Happened to me recently. Files existed. Only visible under the Project...Project tab.
I prefer the Project... Android... tab
It was only showing the "Gradle Scripts" and missing the "app" folder.
App Missing in Android Tab of Android Studio
In Android Studio "Welcome" dialog, remove project from recent list
Close everything Explorer Navigate to folder
C:\Users\Andy\AndroidStudioProjects[project]\
Search *.iml
Delete these files (backup beforehand as always)
Open Android Studio as Administrator
Open Project with “Open” button and browse to file folder
Android tab… “app” should appear now.

How to load project into Android Studio (which files to insert and which to not)?

I'm trying to move a project from one computer to another. Here's how I did it:
From the android project folder, I copied the entire folder from the selected application
Put it on g. drive
Opened the entire folder in the Android Studio of another computer
It's all messed up, the structure of the application is wrong, there are plenty of folders...
When I open only the src folder and the build.gradle file, I get the following error:
ERROR: Plugin with id 'com.android.application' not found.
MyApp Folder (These are all the files that are in the project folder):
What does it look like when I load it:
If you can tell me exactly which files and folders to load, I unfortunately can't access the first computer now so all I have is that folder on the drive.
Close project from the android studio and removing .idea folder and *.iml files, and Then opening project and build.
Try delete the build folder in your project then clean the project and then rebuild it.Make sure your Android studio is equal or higher version then your old computer.If it doesn't work then refer the below link
Error:(1, 0) Plugin with id 'com.android.application' not found

is Android Studio corrupting my project files?

I have two very annoying bugs which is ocurring in the project I am working with. Android Studio keeps overwritting code from many classes using another classes inside the same project.
1 - File contents are wrong
2 - The encoding inside some files seems to have strange characters
For you to have an idea, I will upload a few screenshots below:
This one was supposed to be an enumeration class.
This class was duplicated in another class (overwritting)
This class is all messed up and has strange characters...
At first, I thought the files were really corrupted, then I opened them in their respective folders to check whether it was only in Android Studio or not, and they are completely normal there.
ActivitiesMode.java
ReviewDatesRecyclerView (duplicated file)
ReviewEditRecyclerViewAdapter (UTF Strange characters)
Does someone has an idea on what can be happening?
Should delete:
1) C:\Users\cc.AndroidStudio3.2\system\caches
2) all .iml files in your project folder
3) .idea with .gradle folders.
I managed to solve all these problems by completely reinstalling Android Studio 3.3 and deleting all the configurations and related folders.
At first, I've reinstalled the IDE, but the same problem occured. Then I tried to follow instructions about encoding on this answer "Android Studio : unmappable character for encoding UTF-8"
None of these had any effect.
Here's how I fixed it:
Uninstalled Android Studio
Deleted Android Studio SDK
Deleted .gradle, .android, .AndroidStudio3.3 folders located in C:\Users\MyUserName
Fresh Installed Android Studio 3.3
Opened it's encoding settings on File > Settings > File Encodings
Changed all encoding types to UTF-8 (Global, Project and Default)
Close project
Rename the project root folder name (e.g. Old "Android-Project" new "Android Project") and reopen the project it will solve the problem.

How to change file hierarchy in android studio?

I don't know how but the android studio changed the file hierarchy of my project...
see the image below.
This type was proper the image that is above this line .
The image that is below this line was automatically created by the android studio.
How to change back to the older file hierarchy type??
In left upper corner of Android Studio you need to change the project view to Android. Your current project view is Project.
Android Studio Project Structure (v.s. Eclipse Project Structure)
This link will help you to understand the folder structure of android studio.
And all the new folder created in your project after compile it in android studio is all because of folder structure of android studio and dont worry it will never harm your project.

Android Studio - Can't see Java Directory

Created new project in Android Studio on the desktop.
in the Android view in the Project Explorer all looked normal.
Moved the project to a new folder on the desktop and opened it in Studio.
Now in the Android view in the project explorer there is no dropdown icon on the Java directory.
I have invalidated caches, cleaned the project and probably a couple of other things I have forgotten, still cannot see my source files.
I tried both copy and move using file explorer in win7.
I have faced the same issue, although #Igor answers fix your issue, it was different for me because the Java files are missing in the file directory. Same as you, I've also followed the same steps from https://developer.android.com/training/basics/firstapp/creating-project.html and there's nothing special with those steps.
I have resolved the issue by downloading the SDK quck fix in the "Messages Gradle Sync" explorer.
After that, the java folder will appear to the project explorer.
I've faced a similar issue: I could see my java directory in the Android view, but not in the Project view. I finally managed to fix it by going in the menu: File > Sync Project With Gradle Files.
Hope it helps someone.
Your top-level project in Android Studio should show the absolute path of the directory on your machine. Look in the Project perspective (not Android perspective). Like D:\workspace\myproject. Go ahead and navigate into that directory with file explorer on your machine, and make sure that its java sub-directory contains classes!
If you are using a library project , then you need to add below lines in gradle library level
android {
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
and you need to change the word kotlin to java according to folder name you already have.

Categories

Resources