问题
On typing cordova build android
in a DOS box, nothing is built, but instead I see an error message:
Error: Source path does not exist: resources/android/icon/drawable-hdpi-icon.png
I have updated Cordova, android rm & add everything still no luck. I am a native android developer feeling very hard to learn Cordova hybrid app development please guide me to descriptive link too.
回答1:
If you project is created using Ionic then do the following :-
- Create the folder name "resources" in your projects root directory.
- Place your icon file name as "icon.png" in the resouces folder.
- Icons should be 192x192 px without rounded corners.
- Place your splash file name as "splash.png" in the resources folder.
- Splashscreens should be 2208x2208 px, with the image centered in the middle.
After doing the above open you cli , go to the root of your project and enter
ionic cordova resources
your icon and splash will be generated and config file also will be updated.
If you have created this project using cordova/phonegap :-
- you can either remove the icon tag you specified in your config.xml completely
or
- create the icon and place it in "www/res/icon.png".
- Update the path in config.xml
remove all the icon path and just add this line to your config.xml
<icon src="www/res/icon.png"/>
来源:https://stackoverflow.com/questions/45976052/cordova-android-build-of-icon-path-not-found