java.io.FileNotFoundException:此文件不能打开的文件描述符;它可能是COM pressed [英] java.io.FileNotFoundException: This file can not be opened as a file descriptor; it is probably compressed

查看:1525
本文介绍了java.io.FileNotFoundException:此文件不能打开的文件描述符;它可能是COM pressed的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编程,从Android的一个音板。 的问题是,一些声音作品,和一些不工作。 这里要说的是,我得到了那个不工作的声音中回溯

i am programming a soundboard from android. the problem is that some sounds works, and some dont work. here is the traceback that i get for the sounds that doesnt work

05-31 13:23:04.227 18440 18603 W System.err: java.io.FileNotFoundException: This file can not be opened as a file descriptor; it is probably compressed
05-31 13:23:04.227 18440 18603 W System.err:    at android.content.res.AssetManager.openAssetFd(Native Method)
05-31 13:23:04.227 18440 18603 W System.err:    at android.content.res.AssetManager.openFd(AssetManager.java:331)
05-31 13:23:04.227 18440 18603 W System.err:    at com.phonegap.AudioPlayer.startPlaying(AudioPlayer.java:201)
05-31 13:23:04.227 18440 18603 W System.err:    at com.phonegap.AudioHandler.startPlayingAudio(AudioHandler.java:181)
05-31 13:23:04.235 18440 18603 W System.err:    at com.phonegap.AudioHandler.execute(AudioHandler.java:64)
05-31 13:23:04.235 18440 18603 W System.err:    at com.phonegap.api.PluginManager$1.run(PluginManager.java:86)
05-31 13:23:04.235 18440 18603 W System.err:    at java.lang.Thread.run(Thread.java:1096)

什么想法?

推荐答案

目前在资产文件夹打开COM pressed文件的限制。这是因为,pssed uncom $ P $文件可以直接存储器映射到进程的虚拟地址空间,从而避免再次需要用于DECOM pression相同的内存量。

There is a limitations on opening compressed files in the assets folder. This is because uncompressed files can be directly memory mapped into the processes virtual address space, therefore avoiding needing the same amount of memory again for decompression.

与资产的COM $ P处理$ pssion在Android应用讨论在处理COM pressed文件的一些技巧。你可以欺骗 AAPT 成不COM $ P $使用分机不是COM pressed(如 MP3 ),也可以手动添加获取到 APK 无COM pression代替 AAPT 就做好了。

Dealing with Asset Compression in Android Apps discusses some techniques in dealing with compressed files. You can trick aapt into not compressing the file by using an extension that is not compressed (e.g. mp3) or you can manually add them to the apk without compression instead of getting aapt to do the work.

这篇关于java.io.FileNotFoundException:此文件不能打开的文件描述符;它可能是COM pressed的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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