Android Studio 添加Assets目录

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 enter image description here folder and navigate to the Assets Folder.

enter image description here

On the next screen just click Finish.

enter image description here

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

enter image description here

 

 

 

法三:

 

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" />
 
 
 
 
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)

  

 

posted @   狂奔的小狮子  阅读(31149)  评论(1编辑  收藏  举报
编辑推荐:
· DeepSeek 解答了困扰我五年的技术问题
· 为什么说在企业级应用开发中,后端往往是效率杀手?
· 用 C# 插值字符串处理器写一个 sscanf
· Java 中堆内存和栈内存上的数据分布和特点
· 开发中对象命名的一点思考
阅读排行:
· DeepSeek 解答了困扰我五年的技术问题。时代确实变了!
· PPT革命!DeepSeek+Kimi=N小时工作5分钟完成?
· What?废柴, 还在本地部署DeepSeek吗?Are you kidding?
· DeepSeek企业级部署实战指南:从服务器选型到Dify私有化落地
· 程序员转型AI:行业分析

点击右上角即可分享
微信分享提示