I\'m trying to get an APK file from a Ionic project with the \"cordova build --release android
\" command on a Mac and it doesn\'t work as I get
I had the same error, After running
ionic resources
Or
ionic cordova resources
(Based on the ionic version of your application)
it went away.
The problem was that I had Windows-style slashes (backslashes) in the path of the icon, i.e. the error I had was this:
Error: Source path does not exist: resources\android\icon\drawable-hdpi-icon.png
So, converting backslashes into slashes resolved it for me.
Hope this help to you and the others looking for same problem. It all happens because using different machines[mac & windows] for development of project like mac and windows.
You can add your resources again by running:
ionic integrations enable cordova --add
Just remove <preference name="Orientation" value="portrait" />
in config.xml file and run ionic cordova resources.
Problem is when you run ionic cordova resources it is only generates the resources for portrait orientation.
I resolved the error using the way similar to Fakan. You just need to change the icon tag with src="resources\android\icon\drawable-hdpi.png" outside the platform tags to "resources\icon.png" to resolve this error
In config.xml, I changed the resources\android\icon\drawable-hdpi.png to resources resources\android\icon\drawable-hdpi.png
The problem is because you have:
<preference name="Orientation" value="portrait" />
in your config.xml
, and when you run ionic cordova resources
it is only generating the resources for portrait orientation.