file.checkFile FileError {code: 1, message: "NOT_FOUND_ERR"}



I’m new to Ionic and I have trouble when I try to check if a file exists on android. I don’t know what’s wrong. I can see the file in the directory when I use listDir (this.file.listDir(this.file.applicationDirectory, ‘www/’)). But when I try: this.file.checkFile(this.file.applicationDirectory + ‘www/’, ‘database.db’) I got the error {code: 1, message: “NOT_FOUND_ERR”}.

My code:

this.file.listDir(this.file.applicationDirectory, ‘www/’)
.then(items =>{
for(let i in items){
console.log(items[i]); // I see “database.db” here
.catch(err => {

this.file.checkFile(this.file.applicationDirectory + ‘www/’, ‘database.db’) // FileError {code: 1, message: “NOT_FOUND_ERR”}
.then(entry =>{
.catch(err => {console.log(err)});


The filename in your descriptive paragraph does not match the filename in the code.


Oh, I forgot to change it when writing this post. Thank you