I am trying to use $cordovaFile to delete files from an Android device. The file to be deleted was downloaded using $cordovaFileTransfer in the following location.
ft.download(url, cordova.file.externalDataDirectory + "episodes/" + episodeId + ".mp3",...);
Using the file manager on the device I can see that the file is located at file:///storage/emulated/0/Android/data/com.ionicframework.myapp123456/files/episodes/
`However when I try to use either of the following locations to delete the file I get error code 5 (ENCODING_ERR)
$cordovaFile.removeFile("file:///storage/emulated/0/Android/data/com.ionicframework.myapp123456/files/episodes/", "0.mp3")
$cordovaFile.removeFile(cordova.file.externalDataDirectory + "episodes/", "0.mp3")
That same error occurs when I try to use $cordovaFile.checkDir() so I used window.resolveLocalFileSystemURL() instead.