Move file from temporary folder to external directory not working in android device 8 and above

Hi, I am using IonicMultiCamera plugin,CameraPreview plugin, and ‘cordova-file-plugin’, to capture and move images from cache to a specified folder in externalRootDirectory. This process works well in android version 7 and below, but does not work in android versions 8 and above.

For android version 8 and above the ‘moveFile’ function of ‘cordova-file-plugin’ throws an error as: { code:1, message:‘NOT_FOUND_ERR’}.

Below is the code that i am using to copy images from cache to a specified folder in externalRootDirectory.

/*--------FUNCTION TO CAPTURE IMAGE-------*/
 capturepic()
  {
    this.cachearray=[];
   
      console.log('capturepic');
      const pictureOptions: CameraPreviewPictureOptions = {
        quality: 80,
        width: 640,
        height: 640
      };
      const translations: CameraTranslations = {
        cancel: 'Cancel',
        finish: 'Finish',
        auto: 'AUTO',
        on: 'On',
        off: 'Off'
      };
      this.camera.getPicture(pictureOptions)
      .then((pictures: Array<Picture>) => {
        console.log("success in camera"+JSON.stringify(pictures));
        for(let i=0;i<Object.keys(pictures).length;i++)
        {
          console.log('picturesarray'+JSON.stringify(pictures));
       
        console.log(" getPicture fileEntry "+pictures[i].fileEntry.name)
        
        let imagePath=pictures[i].fileEntry.nativeURL;
        let imagename=pictures[i].fileEntry.name;
        let  imagePatho=imagePath.substr(0,imagePath.lastIndexOf('/')+1);
        let fullpath=imagePath+imagename;
      
        let filepathnew="file:///storage/emulated/0/Customervisitingcard/";
        
        console.log(" imagePatho fileEntry "+imagePatho);
          this.cachearray.push({imagePath:imagePath, imagename:imagename});
          console.log(" cachearray "+JSON.stringify(this.cachearray));
          console.log("iiiiii "+i+" llllll "+(Object.keys(pictures).length-1));
          if(i==Object.keys(pictures).length-1)
          {
            console.log("iffff ");
            this.copyonclick();
          }
       }
      })
      .catch(err => {
        console.log("Error in camera"+err);
      });
   // }
  }

/*--------FUNCTION TO COPY IMAGES-------*/
  copyonclick(){
    console.log("copyonclick"+Object.keys(this.cachearray).length+JSON.stringify(this.cachearray));

    for(let i=0;i<Object.keys(this.cachearray).length;i++)
    {

    let imagePath=this.cachearray[i].imagePath;
    let imagename=this.cachearray[i].imagename;

    let fullpath=imagePath+imagename;
    // let suppliername=this.supplier_name;
    // let productname=this.input;
    // let offerno=this.offernumber;
    let extrtdir = this.file.externalRootDirectory;
    console.log('extrtdir=='+extrtdir);
    let filepathnew= this.file.externalRootDirectory+'Customervisitingcard/'; 
    console.log('imagePath'+imagePath+'imagename'+imagename);
  
     this.resolvefile(imagePath,imagename,filepathnew);
      
    

    }
  }

  resolvefile(imagePath,imagename,filepathnew)
  {
    this.filePath.resolveNativePath(imagePath)
    .then(filePath => {
      let correctPath = filePath.substr(0, filePath.lastIndexOf('/') + 1);
      let currentName = imagename;
      console.log("resolveNativePath "+correctPath+" currentName " + currentName +'filepathnew'+filepathnew);
      this.copyFileToLocalDir(correctPath, currentName, this.createFileName(),filepathnew);
      
    });
    
  }

  private createFileName() {
    console.log("createFileName");
    var d = new Date(),
    n = d.getTime(),
    newFileName =  n + ".jpg";
    return newFileName;
  }
   
 /*--------FUNCTION TO MOVE IMAGES TO SPECIFIED EXTERNAL FOLDER-------*/
  private copyFileToLocalDir(namePath, currentName, newFileName,filepathnew) {
    this.file.moveFile(namePath, currentName, filepathnew, newFileName).then(success => {
 
      this.storedfilepathname = filepathnew+newFileName;
      this.storeimages.push(this.storedfilepathname);
      console.log('storeimages'+JSON.stringify(this.storeimages)+'uuuuuuu'+this.storedfilepathname);
    
      this.file.readAsDataURL(filepathnew, newFileName).then(dataurl => {
        this.lastImage = dataurl;
        this.finalimages.push({src:this.lastImage});
        console.log(" finalimages "+JSON.stringify(this.finalimages));
      },
    (error) =>{
      console.log("readAsDataURL errr "+error.message);
    });
     
      console.log("copyFileToLocalDir"+newFileName);
    }, error => {
      console.log('storeerror='+JSON.stringify(error));
      this.presentToast('Error while storing file.');
    });
  }

I’m noticing something similar for iOS. Have you found any answers on this?