Error: Source Path does not exist for android icon png when building for ionic

For me, in config.xml, path had backward slash in tag, changed it from:

<icon src="resources\android\icon\drawable-xhdpi-icon.png" />

to:

<icon src="resources/android/icon/drawable-xhdpi-icon.png" />

In my case it was a config.xml path issue.

Before I had this:

<icon density="hdpi" src="res/android/ic-hdpi.png" />

but in my folder structure I have an extra folder called icon, so I change all the .png path files to:

<icon density="hdpi" src="res/icon/android/ic-hdpi.png" />

and it worked for me


This actually had to do with my configuration. If you don't specify the platform in your configuration, platform add will create one for you. This automatically includes paths to resources that may not be there.

Update your config.xml to include the platform; even if it is empty:

<platform name="android"/>
<platform name="ios"/>

Then, platform add will not update the platform in the config and look for resources that may not be there. You still should do ionic resources to generate them after the fact, though.