构建 apk 时原始资产重复 [英] Raw assets duplicated when building apk

查看:41
本文介绍了构建 apk 时原始资产重复的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在构建我的应用程序 APK 时,最终的 APK 是我的 Eclipse 项目文件夹的两倍大.我很困惑为什么会发生这种情况,我想让我的应用尽可能小.

When building my application APK, the final APK is twice as big as my Eclipse project folder. I was perplexed as to why this was happening, I'd like to keep my app as small as possible.

我最近不得不通过从发布的 APK 中提取来恢复我的应用程序源,我发现了 APK 如此大的原因,我使用了大约 30 个音频样本,保存为/res/raw/中的 ogg 文件.构建 APK 时,会在 APK 的根目录中创建一个额外的/raw 文件夹,其中包含我所有 ogg 文件的副本.

I've recently had to recover my application source by extracting from a released APK, I found out why the APK is so big, I use about 30 audio samples, saved as ogg files in /res/raw/. When the APK is built, an additional /raw folder is created in the root of the APK, with a duplicate of all of my ogg files.

有没有办法阻止这些文件被复制,Eclipse/ant 是否告诉我这些文件应该在我项目根目录的/raw 文件夹中,而不是/res/raw 中?

Is there a way to stop these files being duplicated, is Eclipse/ant telling me the files should be in a /raw folder in the root of my project, instead of /res/raw?

推荐答案

好吧,这根本不是答案,我仍然不清楚我的项目出了什么问题.

Okay this isn't an answer at all, I'm still no clearer on what was going wrong with my project.

然而,我通过将所有 res 文件复制出我的工作区,从 Eclipse 中删除 res 文件夹(也删除文件),设法阻止了在我的 APK 构建中复制的文件.然后最终手动重新创建整个 res 结构,并通过将它们拖放到 Eclipse 中来重新添加所有原始资产.

I did however manage to stop the files being duplicated in my APK build, by copying all my res files out of my workspace, deleting the res folder from within Eclipse (deleting the files as well). Then finally recreating the entire res structure by hand and re-adding all the raw assets by drag dropping them into Eclipse.

这篇关于构建 apk 时原始资产重复的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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