[Vuejs]-Cordova – Config.xml – resource-file directive not working

1πŸ‘

βœ…

I had a similar issue, after long debugging I found that the tag **only copies if the backup file is of a different size OR if the modification date of the source backup file is newer than the one in the target destination.

Checkout an excerpt from the code I found:

// Copy if the source has been modified since it was copied to the target, or if
// the file sizes are different. (The latter catches most cases in which something
// was done to the file after copying.) Comparison is >= rather than > to allow
// for timestamps lacking sub-second precision in some filesystems.
if (sourceStats.mtime.getTime() >= targetStats.mtime.getTime() ||
    sourceStats.size !== targetStats.size) {
  log('copy  ' + sourcePath + ' ' + targetPath + ' (updated file)');
  fs.copySync(sourceFullPath, targetFullPath);
  updated = true;
}

If your source backup file is the same size and older then you have to update the modification date. That can be done with a command like (on a mac)

touch -m backup.xml

And the you run cordova prepare and then the file should be copied.

I know it is not ideal and strange. The documentation also doesn’t state such a requirement. So that is definitely that needs to be fixed. Oh by the way this already present in previous versions

πŸ‘€leeroyc

Leave a comment