Android Studio 添加Assets目录

本文介绍三种在 Android Studio 中添加 Assets 目录的方法。包括通过 Gradle 构建系统设置、直接在项目中创建 assets 文件夹以及修改 .iml 文件等方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Android Studio 添加Assets目录:

 

法一:

  

1
Since Android Studio uses the  new  Gradle-based build system, you should be putting assets/ inside of the source sets (e.g., src/main/assets/),  if  I understand correctly.

  

法二:

In Android Studio, right-click on the  folder and navigate to the Assets Folder.

On the next screen just click Finish.

It will create the assets folder in the main target source set.

 

 

 

法三:

 

1
2
3
4
5
6
7
8
9
Looking inside the .iml file of your project you will see the following line:
 
 
  <option name= "ASSETS_FOLDER_RELATIVE_PATH"  value= "/src/main/assets" ></option>
 
 
 
 
Therefore the  "assets"  folder is already declared  for  Gradle but you need to create it under src/main/ (I'm  using  AS 0.4.2)

  

 

时刻怀有一颗虔诚之心,乐于分享。知识才更有意义。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值