Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-15821

Android: Unable to access files in Resources folder

    Details

      Description

      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

      (Titanium.Filesystem.getFile(Titanium.Filesystem.resourcesDirectory ,'core/data_providers/phone_db.js').read().text
      

      Testcase app.js

      var win = Ti.UI.createWindow({
      	backgroundColor:'#f00'
      });
       
      win.open();
       
       
       
      var newMsgSound = Titanium.Media.createSound({
      	url: '/samsung_sherbet.mp3',
      	preload: true
      });
      newMsgSound.play();
      
      

      result:

      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)
      
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                cbarber Chris Barber
                Reporter:
                rborn Dan Tamas
                Reviewer:
                Allen Yeung
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-17910
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Source Code