Ionic run android: copyFileSync: could not write to dest file

When I use the command “ionic cordova run android”. I get the error message as

cp: copyFileSync: could not write to dest file (code=ENOENT):D:\product\project-                                                                                                                1\frontend\platforms\android\res\xml\config.xml

Parsing D:\product\project-1\frontend\platforms\android\res\xml\config.xml faile                                                                                                                d
(node:2736) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or dir                                                                                                                ectory, open 'D:\product\project-1\frontend\platforms\android\res\xml\config.xml                                                                                                                '
    at Object.fs.openSync (fs.js:646:18)
    at Object.fs.readFileSync (fs.js:551:33)
    at Object.parseElementtreeSync (D:\product\project-1\frontend\platforms\andr                                                                                                                oid\cordova\node_modules\cordova-common\src\util\xml-helpers.js:180:27)
    at new ConfigParser (D:\product\project-1\frontend\platforms\android\cordova                                                                                                                \node_modules\cordova-common\src\ConfigParser\ConfigParser.js:30:24)
    at updateConfigFilesFrom (D:\product\project-1\frontend\platforms\android\co                                                                                                                rdova\lib\prepare.js:106:18)
    at Api.module.exports.prepare (D:\product\project-1\frontend\platforms\andro                                                                                                                id\cordova\lib\prepare.js:42:20)
    at Api.prepare (D:\product\project-1\frontend\platforms\android\cordova\Api.                                                                                                                js:192:45)
    at C:\Users\hi\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova                                                                                                                -lib\src\cordova\prepare.js:106:36
    at _fulfilled (C:\Users\hi\AppData\Roaming\npm\node_modules\cordova\node_mod                                                                                                                ules\cordova-lib\node_modules\q\q.js:787:54)
    at self.promiseDispatch.done (C:\Users\hi\AppData\Roaming\npm\node_modules\c                                                                                                                ordova\node_modules\cordova-lib\node_modules\q\q.js:816:30)
(node:2736) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This                                                                                                                 error originated either by throwing inside of an async function without a catch                                                                                                                 block, or by rejecting a promise which was not handled with .catch(). (rejection                                                                                                                 id: 1)
(node:2736) [DEP0018] DeprecationWarning: Unhandled promise rejections are depre                                                                                                                cated. In the future, promise rejections that are not handled will terminate the                                                                                                                 Node.js process with a non-zero exit code.

[OK] Your app has been deployed.
     Did you know you can live-reload changes from your app with --livereload?

What is the problem and how can I resolve it? Android emulator is not invoking.

I’m getting the same error now on v4, whereas it worked for a while before.

Any tips?

1 Like