Delete image from device Ionic

Using Ionic 3 File pkugin for removing images from device,


      for(let i=0; i<data.rows.length; i++){
        this.file.removeFile(data(i).location, data(i).picture).then(_ => console.log('deleted')).catch(err => console.log('cannot delete'));
        }, (error) => {
            console.log("Error: " + JSON.stringify(error.err));

Above function deletes images content but file remains on device with exclamation mark. Anyone familiar with this?

@markedjani yes the process is quite painful especially on Android. Only solution I found was similar to yours, but be careful if you have observables, promises, or listeners on anything related to these files, TypeScript will not process the delete message, and stay silent (it’s considered your own design fault). So make sure every potential 2 way data binding thing is well closed before that.