Alexandru Pufan
Alexandru Pufan

Reputation: 1912

cp: copyFileSync: could not write to dest file (code=ENOENT)

I have an Ionic 3.9.2 application, which runs with cordova-android 7.0.0. Everything worked fine until I've installed cordova-plugin-datecs. Now everytime I try to execute the command ionic cordova run android, I get the following error:

cp: copyFileSync: could not write to dest file (code=ENOENT):C:\path-to-the-app\platforms\android\res\xml\config.xml

Is there any solution to solve this, apart from downgrading to a previous version of cordova-android?

What I tried so far:

I understand that the problem is related to cordova changing its file structure in this version, so I guess I should be able to modify some files in the cordova-plugin-datecs to match the new structure, but I've bun unsuccessful until now.

Upvotes: 3

Views: 4536

Answers (1)

Alexandru Pufan
Alexandru Pufan

Reputation: 1912

Solved the problem by modifying plugin.xml file. Needed to replace this line:

<source-file src="src/android/com.datecs.api.jar" target-dir="libs" framework="true" />

with this:

<lib-file src="src/android/com.datecs.api.jar" arch="device" />

Thanks to this pull request for the solutiön:

https://github.com/giorgiofellipe/cordova-plugin-datecs-printer/pull/101

Upvotes: 2

Related Questions