[Bug] Cordova Build: Source and destination must not be the same

Currently the builds with Cordova-Android 8.0.0 will randomly fail (especially on Windows systems).

The reason is, that Cordova uses fs-extra now for file operations like copy.
See Change-Log and the issue

In a nutshell:
fs-extra checks the pathes of file / directory before copy. It sounds great. But the check-method uses the Node fs Inode value to verify it’s the same file. See source code
This is not the best idea. Why?

  • They uses the number type of the value. Not the big-integer. In JavaScript the maximum safe integer is 53-bit. Node fs supports big-integer since version 10.4. see docs. Inode can be a huge value. See the difference between number and big-integer
  • The Inode number is an integer unique to the volume upon which it is stored. This means, you maybe can’t copy a file between volumes.

Here’s the active issue on Github

Please support it, if you want to keep building Apps with Ionic (Cordova).
This is a common issue on the latest Cordova version.

It really often breaks the build.

1 Like