Adding an assets folder in Android Studio
To specify any additional asset folder I've used this with my Gradle. This adds moreAssets
, a folder in the project root, to the assets.
android {
sourceSets {
main.assets.srcDirs += '../moreAssets'
}
}
An image of how to in Android Studio 1.5.1.
Within the "Android" project (see the drop-down in the topleft of my image), Right-click on the app...
You can click on the Project window, press Alt-Insert, and select Folder->Assets Folder. Android Studio will add it automatically to the correct location.
You are most likely looking at your Project with the new(ish) "Android View". Note that this is a view and not the actual folder structure on disk (which hasn't changed since the introduction of Gradle as the new build tool). You can switch to the old "Project View" by clicking on the word "Android" at the top of the Project window and selecting "Project".
According to new Gradle based build system
. We have to put assets
under main
folder.
Or simply right click on your project and create it like
File > New > folder > assets Folder