Android的Assets文件夹不添加到APK [英] Android assets folder not added to apk

查看:1106
本文介绍了Android的Assets文件夹不添加到APK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是pretty新Eclipse和Android和我尝试​​了一些文件添加到文件夹的资产,但不被包括在.apk文件的某些文件和目录。

I'm pretty new to eclipse and Android and I'm trying to add some files to the assets folder, but certain files and directories are not being included in the .apk file.

我已设置以下结构中的溶液

I have set-up the following structure in the solution:

/assets
  /textures
    /test.png
  /xml
    /test.xml

我不知道是否有具体的办法让Eclipse来重新构建/编译该项目,并在.apk文件添加新的资产,资产的文件夹,但/ XML子文件夹(及其内容)是不在apk。随后我得到抛出FilenotFoundExceptions当我部署应用程序。纹理都包括在内。

I don't know if there is a specific way to get eclipse to re-build/compile the project and add the new assets to the assets folder in the .apk, but the /xml subfolder (and its contents) are not in the apk. Subsequently I get FilenotFoundExceptions thrown when I deploy the app. The textures are all included.

我怎么可以强制进行重新编译和APK的重建,并没有什么地方可以手动检查哪些文件包括在项目(类似资产清单文件)?

How can I force a recompile and rebuild of the apk and is there anywhere to manually check which files are included in the project (like an assets manifest file)?

据我知道有没有放在层次或文件格式的资产文件夹中的限制。此外,当我从桌面到解决方案资源管理器中拖动文件,我选择了文件拷贝到项目。

As far as I know there are no restrictions placed on hierarchy or file formats for within the assets folder. Also, when I dragged the files from the desktop to the solution explorer, I selected 'copy files to project'.

感谢

推荐答案

它出现在资产文件夹中的文件的命名可以不使用大写字母。相反,我上面的例子中,我其实是用文件夹中的骆驼支持的文件名。更改文件名以小写后,APK被自动与资产重新修建,下一次我部署

It appears one cannot use upper-case letters in the naming of files within the assets folder. Contrary to my example above, I was actually using camel-backed file names within the folders. After changing the file names to lower-case, the apk was automatically re-built with the assets the next time I deployed

这篇关于Android的Assets文件夹不添加到APK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆