java.io.FileNotFoundException : This file can not be opened as a file descriptor; it is probably compressed

标签 java android cordova filenotfoundexception

我正在从 android 编程音板。 问题是有些声音有效,有些无效。 这是我对不起作用的声音的回溯

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)

有什么想法吗?

最佳答案

您可以为某些扩展禁用 Assets 压缩,如下所示:

android {
    aaptOptions {
        noCompress "pdf"
    }
}

Source

关于java.io.FileNotFoundException : This file can not be opened as a file descriptor; it is probably compressed,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6186866/

相关文章:

java - 如何使用 stanford nlp 情感库获得正面或负面的情感陈述?

android - window.location.reload() 导致 PhoneGap 1.4/Android Honeycomb 3.2.1 上的应用程序错误

java - 如何通过servlet java发送byte[]

java - MyEclipse 不读取导入的证书

java - 使用 Groovy 来 FTP 最新文件

android - JsonRequester 库从内部函数访问监听器

java - 如何向 Android 应用程序添加简单的代码

android - 调试 Mapbox Android NDK 库

javascript - 使用 phonegap 插件需要什么?

Cordova Build - 找不到已安装的 Gradle 版本