When I use the command : ionic cordova build android
here is what I get :
cp: copyFileSync: could not write to dest file (code=ENOENT):/Users/mehdigriche/work/cam1/test/platforms/android/res/xml/config.xml
Parsing /Users/mehdigriche/work/cam1/test/platforms/android/res/xml/config.xml failed (node:2306) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: ENOENT: no such file or directory, open '/Users/mehdigriche/work/cam1/test/platforms/android/res/xml/config.xml'
[10:50:14] lint finished i
Add this hook to cordova project: patch-android-studio-check.js
Put the file patch-android-studio-check.js in the directory hooks of your project
Add the following lines to the config.xml of your project:
<platform name="android">
<hook src="hooks/patch-android-studio-check.js" type="before_plugin_install" />
<hook src="hooks/patch-android-studio-check.js" type="before_plugin_add" />
<hook src="hooks/patch-android-studio-check.js" type="before_build" />
<hook src="hooks/patch-android-studio-check.js" type="before_run" />
<hook src="hooks/patch-android-studio-check.js" type="before_plugin_rm" />
</platform>
Delete the plugins directory:
rm -rf plugins
Reinstall the plugins:
ionic build
Reinstall the platform android:
cordova platform rm android
cordova platform add android@latest
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With