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

Appcelerator JIRA | Dan Tamas | 3 years ago
  1. 0

    It seems that for some reason the files in the Resources folder are not found anymore. The testcase is for a sound file, but the same happens if I try to simply get a file with {code} (Titanium.Filesystem.getFile(Titanium.Filesystem.resourcesDirectory ,'core/data_providers/phone_db.js').read().text {code} *Testcase* app.js {code} var win = Ti.UI.createWindow({ backgroundColor:'#f00' }); win.open(); var newMsgSound = Titanium.Media.createSound({ url: '/samsung_sherbet.mp3', preload: true }); newMsgSound.play(); {code} result: {code} 11-25 16:09:33.319: E/TiSound(17910): (KrollRuntimeThread) [524,525] Error setting file descriptor: 11-25 16:09:33.319: E/TiSound(17910): java.io.FileNotFoundException: This file can not be opened as a file descriptor; it is probably compressed 11-25 16:09:33.319: E/TiSound(17910): at android.content.res.AssetManager.openAssetFd(Native Method) 11-25 16:09:33.319: E/TiSound(17910): at android.content.res.AssetManager.openFd(AssetManager.java:379) 11-25 16:09:33.319: E/TiSound(17910): at ti.modules.titanium.media.TiSound.initializeAndPlay(TiSound.java:100) 11-25 16:09:33.319: E/TiSound(17910): at ti.modules.titanium.media.TiSound.play(TiSound.java:212) 11-25 16:09:33.319: E/TiSound(17910): at ti.modules.titanium.media.SoundProxy.play(SoundProxy.java:151) 11-25 16:09:33.319: E/TiSound(17910): at org.appcelerator.kroll.runtime.v8.V8Runtime.nativeRunModule(Native Method) 11-25 16:09:33.319: E/TiSound(17910): at org.appcelerator.kroll.runtime.v8.V8Runtime.doRunModule(V8Runtime.java:159) 11-25 16:09:33.319: E/TiSound(17910): at org.appcelerator.kroll.KrollRuntime.handleMessage(KrollRuntime.java:289) 11-25 16:09:33.319: E/TiSound(17910): at org.appcelerator.kroll.runtime.v8.V8Runtime.handleMessage(V8Runtime.java:185) 11-25 16:09:33.319: E/TiSound(17910): at android.os.Handler.dispatchMessage(Handler.java:95) 11-25 16:09:33.319: E/TiSound(17910): at android.os.Looper.loop(Looper.java:156) 11-25 16:09:33.319: E/TiSound(17910): at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112) 11-25 16:09:33.319: I/MediaPlayer(17910): setLPAflag() in 11-25 16:09:33.319: I/MediaPlayer(17910): mContext is null, can't getMirrorDisplayStatus!!! 11-25 16:09:33.319: I/MediaPlayer(17910): setLPAflag() out 11-25 16:09:33.319: E/MediaPlayer(17910): prepareAsync called in state 1 11-25 16:09:33.329: W/TiSound(17910): (KrollRuntimeThread) [7,532] Issue while initializing : 11-25 16:09:33.329: W/TiSound(17910): java.lang.IllegalStateException 11-25 16:09:33.329: W/TiSound(17910): at android.media.MediaPlayer._prepare(Native Method) 11-25 16:09:33.329: W/TiSound(17910): at android.media.MediaPlayer.prepare(MediaPlayer.java:1341) 11-25 16:09:33.329: W/TiSound(17910): at ti.modules.titanium.media.TiSound.initializeAndPlay(TiSound.java:153) 11-25 16:09:33.329: W/TiSound(17910): at ti.modules.titanium.media.TiSound.play(TiSound.java:212) 11-25 16:09:33.329: W/TiSound(17910): at ti.modules.titanium.media.SoundProxy.play(SoundProxy.java:151) 11-25 16:09:33.329: W/TiSound(17910): at org.appcelerator.kroll.runtime.v8.V8Runtime.nativeRunModule(Native Method) 11-25 16:09:33.329: W/TiSound(17910): at org.appcelerator.kroll.runtime.v8.V8Runtime.doRunModule(V8Runtime.java:159) 11-25 16:09:33.329: W/TiSound(17910): at org.appcelerator.kroll.KrollRuntime.handleMessage(KrollRuntime.java:289) 11-25 16:09:33.329: W/TiSound(17910): at org.appcelerator.kroll.runtime.v8.V8Runtime.handleMessage(V8Runtime.java:185) 11-25 16:09:33.329: W/TiSound(17910): at android.os.Handler.dispatchMessage(Handler.java:95) 11-25 16:09:33.329: W/TiSound(17910): at android.os.Looper.loop(Looper.java:156) 11-25 16:09:33.329: W/TiSound(17910): at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112) {code}

    Appcelerator JIRA | 3 years ago | Dan Tamas
    java.io.FileNotFoundException: This file can not be opened as a file descriptor; it is probably compressed
  2. 0

    It seems that for some reason the files in the Resources folder are not found anymore. The testcase is for a sound file, but the same happens if I try to simply get a file with {code} (Titanium.Filesystem.getFile(Titanium.Filesystem.resourcesDirectory ,'core/data_providers/phone_db.js').read().text {code} *Testcase* app.js {code} var win = Ti.UI.createWindow({ backgroundColor:'#f00' }); win.open(); var newMsgSound = Titanium.Media.createSound({ url: '/samsung_sherbet.mp3', preload: true }); newMsgSound.play(); {code} result: {code} 11-25 16:09:33.319: E/TiSound(17910): (KrollRuntimeThread) [524,525] Error setting file descriptor: 11-25 16:09:33.319: E/TiSound(17910): java.io.FileNotFoundException: This file can not be opened as a file descriptor; it is probably compressed 11-25 16:09:33.319: E/TiSound(17910): at android.content.res.AssetManager.openAssetFd(Native Method) 11-25 16:09:33.319: E/TiSound(17910): at android.content.res.AssetManager.openFd(AssetManager.java:379) 11-25 16:09:33.319: E/TiSound(17910): at ti.modules.titanium.media.TiSound.initializeAndPlay(TiSound.java:100) 11-25 16:09:33.319: E/TiSound(17910): at ti.modules.titanium.media.TiSound.play(TiSound.java:212) 11-25 16:09:33.319: E/TiSound(17910): at ti.modules.titanium.media.SoundProxy.play(SoundProxy.java:151) 11-25 16:09:33.319: E/TiSound(17910): at org.appcelerator.kroll.runtime.v8.V8Runtime.nativeRunModule(Native Method) 11-25 16:09:33.319: E/TiSound(17910): at org.appcelerator.kroll.runtime.v8.V8Runtime.doRunModule(V8Runtime.java:159) 11-25 16:09:33.319: E/TiSound(17910): at org.appcelerator.kroll.KrollRuntime.handleMessage(KrollRuntime.java:289) 11-25 16:09:33.319: E/TiSound(17910): at org.appcelerator.kroll.runtime.v8.V8Runtime.handleMessage(V8Runtime.java:185) 11-25 16:09:33.319: E/TiSound(17910): at android.os.Handler.dispatchMessage(Handler.java:95) 11-25 16:09:33.319: E/TiSound(17910): at android.os.Looper.loop(Looper.java:156) 11-25 16:09:33.319: E/TiSound(17910): at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112) 11-25 16:09:33.319: I/MediaPlayer(17910): setLPAflag() in 11-25 16:09:33.319: I/MediaPlayer(17910): mContext is null, can't getMirrorDisplayStatus!!! 11-25 16:09:33.319: I/MediaPlayer(17910): setLPAflag() out 11-25 16:09:33.319: E/MediaPlayer(17910): prepareAsync called in state 1 11-25 16:09:33.329: W/TiSound(17910): (KrollRuntimeThread) [7,532] Issue while initializing : 11-25 16:09:33.329: W/TiSound(17910): java.lang.IllegalStateException 11-25 16:09:33.329: W/TiSound(17910): at android.media.MediaPlayer._prepare(Native Method) 11-25 16:09:33.329: W/TiSound(17910): at android.media.MediaPlayer.prepare(MediaPlayer.java:1341) 11-25 16:09:33.329: W/TiSound(17910): at ti.modules.titanium.media.TiSound.initializeAndPlay(TiSound.java:153) 11-25 16:09:33.329: W/TiSound(17910): at ti.modules.titanium.media.TiSound.play(TiSound.java:212) 11-25 16:09:33.329: W/TiSound(17910): at ti.modules.titanium.media.SoundProxy.play(SoundProxy.java:151) 11-25 16:09:33.329: W/TiSound(17910): at org.appcelerator.kroll.runtime.v8.V8Runtime.nativeRunModule(Native Method) 11-25 16:09:33.329: W/TiSound(17910): at org.appcelerator.kroll.runtime.v8.V8Runtime.doRunModule(V8Runtime.java:159) 11-25 16:09:33.329: W/TiSound(17910): at org.appcelerator.kroll.KrollRuntime.handleMessage(KrollRuntime.java:289) 11-25 16:09:33.329: W/TiSound(17910): at org.appcelerator.kroll.runtime.v8.V8Runtime.handleMessage(V8Runtime.java:185) 11-25 16:09:33.329: W/TiSound(17910): at android.os.Handler.dispatchMessage(Handler.java:95) 11-25 16:09:33.329: W/TiSound(17910): at android.os.Looper.loop(Looper.java:156) 11-25 16:09:33.329: W/TiSound(17910): at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112) {code}

    Appcelerator JIRA | 3 years ago | Dan Tamas
    java.io.FileNotFoundException: This file can not be opened as a file descriptor; it is probably compressed
  3. 0

    Phonegap Media error code 1 playing local mp3 file in Android device

    Stack Overflow | 5 years ago | kripa
    java.io.FileNotFoundException: This file can not be opened as a file descriptor; it is probably compressed
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Problem while opening Asset File with the help of Content Provider

    Stack Overflow | 6 years ago | Andhravaala
    java.io.FileNotFoundException: This file can not be opened as a file descriptor; it is probably compressed
  6. 0

    FileNotFoundException when opening wav file from android assets

    Stack Overflow | 3 years ago | noned
    java.io.FileNotFoundException: This file can not be opened as a file descriptor; it is probably compressed
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.io.FileNotFoundException

    This file can not be opened as a file descriptor; it is probably compressed

    at android.content.res.AssetManager.openAssetFd()
  2. Android Platform
    AssetManager.openFd
    1. android.content.res.AssetManager.openAssetFd(Native Method)
    2. android.content.res.AssetManager.openFd(AssetManager.java:379)
    2 frames
  3. ti.modules.titanium
    SoundProxy.play
    1. ti.modules.titanium.media.TiSound.initializeAndPlay(TiSound.java:100)
    2. ti.modules.titanium.media.TiSound.play(TiSound.java:212)
    3. ti.modules.titanium.media.SoundProxy.play(SoundProxy.java:151)
    3 frames
  4. org.appcelerator.kroll
    V8Runtime.handleMessage
    1. org.appcelerator.kroll.runtime.v8.V8Runtime.nativeRunModule(Native Method)
    2. org.appcelerator.kroll.runtime.v8.V8Runtime.doRunModule(V8Runtime.java:159)
    3. org.appcelerator.kroll.KrollRuntime.handleMessage(KrollRuntime.java:289)
    4. org.appcelerator.kroll.runtime.v8.V8Runtime.handleMessage(V8Runtime.java:185)
    4 frames
  5. Android Platform
    Looper.loop
    1. android.os.Handler.dispatchMessage(Handler.java:95)
    2. android.os.Looper.loop(Looper.java:156)
    2 frames
  6. org.appcelerator.kroll
    KrollRuntime$KrollRuntimeThread.run
    1. org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112)
    1 frame