title: List files on directory on phonegap build
body: <p>Hi im currently trying to create an gallery app with phonegap build, but i cant read files from the local storage. I`m using this function:</p>
  
  <pre><code>function listDir(directoryEntry){
  
   var directoryReader = directoryEntry.createReader();
  
   directoryReader.readEntries(function(entries){ // success get files and folders
      for(var i=0; i&lt;entries.length; ++i){
        alert(entries[i].name) // this is just for checking purposes, no matter what  i       put here it wont fire
      }
   }, function(error){ // error get files and folders
      alert(error.code);
   });
  }
  
    function getFileSystem(){
      window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(fileSystem){ //    success get file system
      var sdcard = fileSystem.root;
      sdcard.getDirectory('dcim',{create:false}, function(dirEntry){
          listDir(dirEntry);
      }, function(error){
          alert(error.code);
      })
      }, function(evt){ // error get file system
          console.log(evt.target.error.code);
      });
    }
  
  
    getFileSystem();
  </code></pre>
  
  <p>The listDir function wont even fire (the error function wont too). I have tried to add an "OnDeviceReady" listener to call the getFileSystem() function but it wont work too, plus i have tried toons of ways, even using the official phonegap docs, but it can<code>t read my directory. Anyone know how to do this (i</code>m currently using android)? Thanks in advance.</p>