window.resolveLocalFileSystemURL is not a function error

I am working on an android app where the user’s picture captured through the camera is to be sent to the microsoft face api for face detection. I am trying to do this by converting the image into blob and then sending the blob object as data in the post request. However, I am not able to convert the image into blob. Here is the code I am using for the conversion:

quality: 100,
saveToPhotoAlbum: true
}).then((_imagePath) => {

  alert('got image path ' + _imagePath);
  return this.makeFileIntoBlob(_imagePath); }).then((_imageBlob) => {
alert('got image blob ' + _imageBlob);
  },(err) => {


makeFileIntoBlob(_imagePath) {

return new Promise((resolve, reject) => {
ionic.Platform.ready().then( () => {
alert(“platform ready”);
window.resolveLocalFileSystemURL(_imagePath, (fileEntry) => {
alert(“inside resolve local file system url.”);
fileEntry.file((resFile) => {
var reader = new FileReader();
reader.onloadend = (evt: any) => {
var imgBlob: any = new Blob([], { type: ‘image/jpeg’ }); = ‘sample.jpg’;

    reader.onerror = (e) => {
      console.log('Failed file read: ' + e.toString());



The code gives me a window.resolveLocalFileSystemURL is not a function error while testing with an image on browser. I am using ionic-native/file for this. I have tried a few things like - adding “AndroidExtraFilesystems” tag to config.xml , switched to npm version 5.0.3. But, I am not able to figure out the cause of the error. While, testing it on android device, neither I am getting any error nor is the app getting stuck. It just doesn’t give any alert after the makeFileIntoBlob function is called. I am stuck on it for days now. Any help is highly appreciated.


1 Like

Make sure you installed cordova file plugin


ionic cordova plugin ls

and look for cordova-plugin-file
if it’s not there, which is likely
run this command

ionic cordova plugin add cordova-plugin-file
1 Like

Same issue did u resolve it??