Issue
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?
Solution
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.
Answered By - Explosion Pills
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.