While working on my Ionic 3 app, I encountered an issue when trying to copy a file to a new directory using the Cordova plugin file. The error message states:
Argument of type 'Entry' is not assignable to parameter of type 'DirectoryEntry'. Property 'createReader' is missing in type 'Entry'
Has anyone found a solution to overcome this problem?
Here's the code snippet causing the issue:
this.file.resolveLocalFilesystemUrl(sourceFilePath).then(fileEntry =>
{
if(newName == null)
newName = fileEntry.nativeURL.split('/').pop();
else if(newName == "")
newName = fileEntry.nativeURL.split('/').pop();
this.file.resolveLocalFilesystemUrl(targetDirectoryPath).then(dirEntry => {
fileEntry.copyTo(dirEntry, newName, entry =>{
resolve(newName);
}, function(error){
resolve(newName);
});
});
});