Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Your system information:

Cordova CLI: 6.5.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
OS: macOS Sierra
Node Version: v6.9.5
Xcode version: Xcode 8.2.1 Build version 8C1002

I am trying to use ionic platform add android to create an android project, but it always complains that resources/android/icon/drawable-hdpi-icon.png does not exist. In fact it doesn't -- none of these resources exist. They can get created by ionic resources.

However if I try to run ionic resources without the platform, I am told to add the platform first. This leads me to essentially do something like:

ionic platform add android
ionic resources
ionic platform rm android
ionic platform add android

Then it works properly. Is there anything I can do to make sure the resources get properly built or referenced before adding the platform?

like image 769
Explosion Pills Avatar asked Feb 07 '17 21:02

Explosion Pills


2 Answers

For Ionic this works for me:

npm i -g cordova-res
ionic cordova resources --cordova-res

found here https://github.com/ionic-team/ionic-cli/issues/3762#issuecomment-456967033

Think it's an mac/windows-issue.

like image 138
Mi Be Avatar answered Sep 22 '22 10:09

Mi Be


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" />
like image 27
RohitAneja Avatar answered Sep 22 '22 10:09

RohitAneja