Issue
I have an ionic cordova project in which i tried to run with ionic cordova run android (sometimes with sudo too) and it returns me this error: error: unknown flag p'
and /usr/bin/snap: Command failed with exit code 64
.
I have tried reinstalling node, npm, ionic and cordova but it hasn’t worked out for me :/
I also have removed platforms, removed plugins, node_modules but no luck also.
When i do a ionic cordova prepare android, the script runs perfectly but i get this error when i try to run or emulate it
My node version is v10.24.0, npm version 6.14.11, ionic 5.4.12 and cordova 10.0.0
Solution
I have finnaly solved it by uninstalling gradle and then installing it again on version 5.6.3
Answered By – Haroldo Beyer
This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0