File plugin not always resolving

#1

I’m finding that the file plugin doesn’t always resolve it’s promise when using writeFile. The very straightforward code I’m using is:

this.file.writeFile(${this.file.dataDirectory}tours/${id}/, filename, response, {replace: true})
.then(success => {
alert(‘worked’);
})
.catch(error => {
alert(‘failed’);
});

I’m having this problem on multiple android devices. Sometimes uninstalling the app and re-installing the app seems to make it work.

When the issue does raise its head it seems like it saves something to disk because the files appear to be on the device. When trying to play them back, I’m saving mp3 files, nothing gets played.

Has anyone else encountered this? Can anyone help? This is fairly crucial to the app I’m trying to build.

Here’s my Ionic info.

Ionic:

ionic (Ionic CLI) : 4.0.1 (C:\Users\Richard\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.1.11

Cordova:

cordova (Cordova CLI) : 7.1.0
Cordova Platforms : android 6.3.0

System:

NodeJS : v8.9.0 (C:\Program Files\nodejs\node.exe)
npm : 5.6.0
OS : Windows 7

Environment:

ANDROID_HOME : C:\Program Files\Android\tools