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

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


当前回答

选择应用程序文件夹,然后:

文件>新建>文件夹>资产文件夹,

默认位置在/main文件夹中

其他回答

步骤1:转到文件。步骤2:转到文件夹。步骤3:创建资源文件夹。

在“资源”文件夹中,只需放置字体并在需要时使用。

在android studio中,您可以指定源、资源和资产文件夹的位置。对于build.gradle文件中的每个模块/应用程序,您可以添加如下内容:

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.1"

    sourceSets {
        main {
            java.srcDirs = ['src']
            assets.srcDirs = ['assets']
            res.srcDirs = ['res']
            manifest.srcFile 'AndroidManifest.xml'
        }
    }
}
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 

文件>新建>文件夹>资产文件夹

让安卓工作室为您做这件事。

在Android Studio(1.0及以上版本)中,右键单击文件夹并导航到资产文件夹。

在下一个屏幕上,只需单击Finish。

瞧!它将在主目标源集中创建资产文件夹。