File not completely deleted

 const file = fileSystemModule.File.fromPath(f[k]);
 file.remove().then((res) => {
  }).catch((err) => {

When I use this code the file get partially deleted. The file cannot open if you try to open it in the gallery but it does not get removed out of the gallery. Can anyone offer some help?


There can be 2 reasons,

  1. Somehow you are trying to access the file again after deleting it, so it creates an empty file.
  2. You might have to delete the entry from Android’s Media Store.


Ok, thank you for your response. Can you say how do I delete the entry from the android media store?


Use scanFile with your folder path.

Refer this doc to know how to convert this to JS / TS.


Thank you again. I really appreciate your help.