4

I am trying to add an assets folder in Android Studio but it is not an option to me. When I go into the android view and try to create a new folder I am only presented with these options. enter image description here An alternative answer I found was to go to the packages view; however, I could not see my project directory from there. Does anyone know a way to add it as an option? Thanks!

3
  • You can create src/main/assets/ directory and android studio will load it Commented Jan 22, 2020 at 23:10
  • 1
    your code is not recognized as runnable, try to invalidate caches and restart from the file menu Commented Jan 22, 2020 at 23:11
  • @LenaBru I invalidated caches and restarted as you suggested and the same issue is present. Would you be able to explain more why I cannot create an assets folder for code not recognized as runnable? I am new to android studio and it seems like I should still be able to create a directory even if I cannot run code. Commented Jan 23, 2020 at 2:58

3 Answers 3

7

Right-click on app folder go to New> Folder>Assets Folder.
Android Studio will open a dialog box. Keep all the settings default. Under the target source set, option main should be selected. and click finish.

Sign up to request clarification or add additional context in comments.

4 Comments

I shared a picture in my question where this is not present as an option to me. I am able to create a new directory and name it assets, but I am unsure (and doubtful) that this is the same thing.
I hope that creating it in that way will work Did you try to run the project or something before?
What I meant to say is I would like to have the other options available as I am unsure why they are not listed for me.
@mradey right click on "app" folder you will get the folders option
1

I resolved the issue. My gradle file was not updated and I needed to sync dependencies. Once doing that I was presented with the option to create an assets folder.

Comments

0

In menu item it says requires min sdk >= 16, modify build.gradle it works. reference.

android { compileSdkVersion 26 defaultConfig { applicationId "android" minSdkVersion 16 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.