Cordova File writeFile() doesn't work on production

Hello Everyone,

I am trying to create a PDF file using file (https://ionicframework.com/docs/v3/native/file/) writeFile() function. I am getting a BLOB Data from an API then pass it to the writeFile() function. This works on development mode (ionic cordova run android --device) but when I try it on the production mode (ionic cordova build android --prod --release) it creates the file but when I try to open it, it returns Invalid file format message.

Here is my code:

     this.file.writeFile(this.filePath, fileName, pdfFile).then(() => {
        //console.log('success');
      });

I don’t know what happened. I hope someone can help me with this. Thank you in advance :blush: