简体   繁体   English

Android资源文件夹未添加到APK

[英]Android assets folder not added to 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. 我对eclipse和Android相当陌生,我正在尝试将一些文件添加到资产文件夹中,但是.apk文件中未包含某些文件和目录。

I have set-up the following structure in the solution: 我在解决方案中设置了以下结构:

/assets
  /textures
    /test.png
    /splash.png
  /xml
    /testData.xml

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. 我不知道是否有一种特定的方法可以使Eclipse重新生成/编译项目并将新资产添加到.apk中的资产文件夹中,但是/ xml子文件夹(及其内容)不在其中。 apk。 Subsequently I get FilenotFoundExceptions thrown when I deploy the app. 随后,当我部署应用程序时,我抛出FilenotFoundExceptions。 The textures are all included. 所有的纹理都包括在内。

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)? 如何强制重新编译和重建apk,并且可以在任何地方手动检查项目中包含哪些文件(例如资产清单文件)?

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'. 另外,当我将文件从桌面拖到解决方案资源管理器时,我选择了“将文件复制到项目”。

Thanks 谢谢

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 将文件名更改为小写后,下次我部署时,apk将自动用资产重建

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM