我对资产文件夹感到困惑。它不是在AndroidStudio中自动创建的,几乎所有讨论它的论坛都讨论Eclipse。

如何在Android Studio中配置资产目录?


当前回答

如果你在这个线程中尝试了所有的子弹都没有用,那就尝试清理你的项目。在我的情况下,它只在Projet->清洁后起作用

其他回答

单击主视图→ 新建->目录→ 并键入名称“assets”

或main->new->folder->assets文件夹(参见图片)

项目->app->src->main->RMB(鼠标右键)->新建->目录:

需要为渐变配置参数我希望它能奏效

// file: build.gradle  
sourceSets {
    main {
        assets.srcDirs = ['src/main/res/icon/', 'src/main/assets/']
    }
}

将assets文件夹放在main/src/assets路径中。

follow these steps 

1)file->New->Folder
 there are multiple options like
      aidl folder
      assets folder
      jni folder
2) choose options assets folder
3) then there is option to change path of assets folder if you 
    want to change then check otherwise left that checkbox of cahnge folder location
4) click on finish