File Provider Not Working

Hi All.

I am trying to implement the file provider so that I can write files that I have saved on my app to my server and then save in the DB.

Doing the following to create the file works perfect:

this.fileLocation = this.file.externalCacheDirectory

const fileName = `${DateTime.local().toFormat('yyyy-LL-dd')}.log`
const tempBlob = new Blob([data + '\n \n'], { type: 'text/plain' })
return await this.file.writeFile(`${this.fileLocation}/logs`, fileName, tempBlob, {
  replace: false,
  append: true

However, when I try to read the files like this, no data is returned:

    .then(res => {
      console.log('File Data: ', res)
    .catch(error => {
      console.error('No file data ', error)

I do not get any kind of response back what-so-ever. Neither the ‘then’ or ‘catch’ blocks are hit.

I have checked what documentation I could find and looked in the various forums but am yet to find an answer.

Any assistance that you can provide will be greatly appreciated!

Here is my Ionic info:

   Ionic CLI          : 6.6.0 (/Users/.../.npm-global/lib/node_modules/@ionic/cli)
   Ionic Framework    : ionic-angular 3.9.5
   @ionic/app-scripts : 3.2.2


   Cordova CLI       : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms : android 7.1.4
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.1, (and 13 other plugins)


   cordova-res (update available: 0.15.2) : 0.11.0
   native-run (update available: 1.2.2)   : 0.2.8


   Android SDK Tools : 26.1.1 (/Users/euanscott/Library/Android/sdk)
   NodeJS            : v13.12.0 (/usr/local/bin/node)
   npm               : 6.14.4
   OS                : macOS Catalina
   Xcode             : Xcode 12.1 Build version 12A7403


Turns out, simply doing a prod build solves the problem. I can’t do a livereload build, only prod to get it working.

I am however going to leave this ticket open incase anyone else has a better solution.