I downloaded a project from Github, trying to rebuild it myself for learning purposes. I'm new to Android Studio, developing on a Mac. Having trouble with what I think would be simple tasks.
The source project from Github I downloaded has several different sub directories containing image resources under the res/drawable folder. I was hoping I could just copy and paste these assets into my own project. It doesn't seem to work the way I'd expect and I don't understand what is going on.
I've tried right clicking and copy/pasting the directory I'd like to duplicate from the Github project (opened in Android Studio) into the drawable folder in my new project (Also opened in AS). Nothing seems to happen when I do this. Right clicking and selecting "reveal in finder" reveals a still unfortunately empty drawable folder.
I also tried right clicking on the specific directory I'd like to copy from the Github project and selecting "reveal in finder", thinking I'd try copying and pasting it from there into my new project. Oddly enough when I do this, the same directory isn't even the one that's opened. Instead, it opens a drawable-hdpi folder containing several assets, but it's definitely not the one I was attempting to open.
I've tried right clicking and "synchronizing" the drawable folder in my new project after copy/pasting, still no luck.
You can not copy android folders or directories directly into android studio. But you can copy individual files into there respective folders in your project.
If you want to copy folders/ directories you can open the android app folder in your MAC browser and go to Application/app/src/main and paste whatever you have in the respective folders.
The main folder conrains java and res folders and an AndroidManifest.xml file.
You can paste xml files , drawables and pngs etc in res and java classes will go into java folder.
I'm using Android Studio and I want to create a directory folder inside the lib folder. I right-clicked on the lib folder but the directory option is not showing.
Can anyone suggest to me how to create a directory folder inside a folder?
You need to go File -> Project structure.
Select lib folder and unmark as source
Right click on the package then "Mark Directory as" -> Unmark as Sources Root. All child packages will be seen as folders.
Try to create package instead of a directory. Seems like Create New Package and Create New Directory will both just create a folder under lib directory.
I found a solution that worked for me In Mac OS,
1- Click over file and select project structure
2 - After, you should click on the lib folder, then unselect the "Source" from top
3- Then, click on Apply then Ok Buttons
4- Now when you try to create a directory on lib you will found the Directory option appears.
Hopefully, that's what you need.
Yeah I had the same problem, so you just have to follow these steps:
1) Go to project structure
Here:
2) Go to Modules and find "Sources" tab
Click here
3) Uncheck Sources and click "Apply"!
(at the beginning it was unchecked and it didn't work, but when I checked "Sources", my folders changed as it was at the beginning(like packages), so I unchecked again and folders changed, and now I can create directories, not packages, hope it helped you!)
Like this:
This was reported here
It's an IntelliJ issue in how they deal with folders marked as source. The lib folder needs to be a source folder for internal flutter purposes. The best way is to use your file manager or terminal to create the folder.
Step 1: There is no pre featured option in Android for adding raw folder unlike Assets folder. Open App folder and select res folder
Step 2: Right click on res folder, select New> Directory, then studio will open a dialog box and it will ask you to enter the name.
Step 3: Write “raw” and click OK. Open res folder and you will find your raw folder under it.
Now you have created raw folder in your project.
You can use the in-built IDE terminal to create the folders.
Here is complete solution that works. Click the link to see images.
Issue
Problem- Cannot create Directory
1)Cannot Create Directory
Click the Gear icon and Untick Compact Middle Package
2)Click Gear icon and Untick Compact Middle Package
Package Structure gets expanded
3)Now Expanded Package View can be seen
Still Not possible to create Directory
4)Still cannot create package
Do as shown in the image
5)Right click Package COM->Mark Directory as->Unmark as Source root
Packages are expanded and now you can create Directory
6)Now the packages are expanded and now Directory can be created
For creating the folder in case of flutter framework in Android studio, follow the steps as shown below:-
Right click on the folder with the name of your app i.e. the root folder.
In the drop down menu click on the new option.
After this a drop down menu opens here you will see directory option just click on that.
After this enter the name of your directory / folder and press enter this will create a new folder / directory inside your root folder.
If you want to make the directory inside the lib folder then just drag the directory from the root folder into the lib folder.
After this a dialog box will open in this dialog box check if search for references is tick marked or not if not then tick mark it.
Now click ok this will create your directory inside the lib folder.
Hope this may help.
I added a new activity which is under following Package
Activities -> UserManagement -> Auth -> Login
Here is the screenshot
Now, I am trying to add a new Package which should be under Activities Package.
Here the problem is that I have no option to add a new Package under Activities because they are combined with dot.
Can you please suggest how could I add the new Package under Activities.
Create a new file by performing a right click on the package shown and Create a new Class file.
In the window that opens up, once you type in the filename, there will be another textbox called Package where a specific package path will be shown. Edit that to the required package location where this file has to be created. This will automatically expand the tree structure shown in Android Studio.
Sorry for this dumb question but i cannot create a new java class file inside my package. Are there any limitations in the deep of packages?
Choose new -> File. Enter valid name, press enter. In the upcoming dialog choose Java Class
I had to right-click on root/app/src/main/java.
Ensure that you've opened the project directory correctly.
The Directory that you open as project should have the gradlew batch file, your project iml file etc.
For me, I was trying to open it from a parent directory above the project directory and I was seeing the same issue.
In MonoDevelop I can right click a file in a MonoTouch project and select "Remove" and it then gives me an option of removing the file from the project. However, if I right click a folder, the only option available is "Delete" which brings up a confirmation box saying that the entire folder will be deleted. How do I remove a folder from a MonoTouch project? Does this functionality exist somewhere or has it not been built yet?
I think the easiest way to do this is to handle all the files outside of monodevelop. Just move it to wherever you like and then delete the folder from inside monodevelop.