ionic-cli: ionic cordova build ios gives Error: Source path does not exist: resources/ios/icon/icon-40.png
Description:
With IOS releases and x-code, I tried to create IOS build and uploaded itunes connect, I got the following error. “Missing Marketing Icon - iOS Apps must include a 1024x1024px Marketing Icon in PNG format. Apps that do not include the Marketing Icon cannot be submitted for App Review or Beta App Review”
To solve above error, it looks like new ionic cli is released “ionic@3.12.0”. I have installed this update and tried to remove IOS platform and add it and then generate resources, it is giving the error Error: Source path does not exist: resources/ios/icon/icon-40.png.
I could see that ios folder in resource is not created with this update.
Steps to Reproduce:
- Update ionic cli
- sudo ionic cordova platform rm ios
- sudo ionic cordova platform add ios
- sudo ionic cordova resources ios
Output:
SidhuMac-2:chitmonks-app sidhu$ sudo ionic cordova platform rm ios
cordova platform remove ios --save ✔ Running command - done! Removing platform ios from config.xml file… SidhuMac-2:chitmonks-app sidhu$ sudo ionic cordova platform add ios cordova platform add ios --save ✖ Running command - failed! [ERROR] Exception: Using cordova-fetch for cordova-ios@~4.4.0
Adding ios project...
Creating Cordova project for the iOS platform:
Path: platforms/ios
Package: com.chitmonks.app
Name: ChitMonks
iOS project created with cordova-ios@4.4.0
Error: Source path does not exist: resources/ios/icon/icon-40.png
SidhuMac-2:chitmonks-app sidhu$ sudo ionic cordova resources ios ✔ Collecting resource configuration and source images - done!
? Platform ios not detected. Would you like to install it? No [ERROR] Platform ios not installed. SidhuMac-2:chitmonks-app sidhu$ sudo ionic cordova platform rm ios
cordova platform remove ios --save ✔ Running command - done! Removing platform ios from config.xml file… SidhuMac-2:chitmonks-app sidhu$ sudo ionic cordova resources ios ✔ Collecting resource configuration and source images - done!
? Platform ios not detected. Would you like to install it? Yes
cordova platform add ios --save ✖ Running command - failed! [ERROR] Exception: Using cordova-fetch for cordova-ios@~4.4.0
Adding ios project...
Creating Cordova project for the iOS platform:
Path: platforms/ios
Package: com.chitmonks.app
Name: ChitMonks
iOS project created with cordova-ios@4.4.0
Error: Source path does not exist: resources/ios/icon/icon-40.png
My ionic info
:
cli packages: (/usr/local/lib/node_modules)
@ionic/cli-utils : 1.12.0
ionic (Ionic CLI) : 3.12.0
global packages:
cordova (Cordova CLI) : 7.0.1
local packages:
Cordova Platforms : android 6.2.3 ios 4.4.0
Ionic Framework : ionic1 1.3.2
System:
ios-deploy : 1.9.1
Node : v6.9.1
npm : 3.10.8
OS : macOS Sierra
Xcode : Xcode 9.0 Build version 9A235
Misc:
backend : legacy
Other Information: None
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 22 (3 by maintainers)
The root problem is that the
resources/ios/icon/icon-40.png
image exists as defined inconfig.xml
, but doesn’t actually exist on the file system, so Cordova errors.ionic cordova resources -f
should recreate the necessary resources.After I removed platforms via CLI and deleted all
<platform>
along with<icon>
and<splash>
from myconfig.xml
I was able to add platforms back successfully and build as well.I have the same issue. Just remove resources, remove platform and try to add platform.
Trying to generate resources:
In my case: The current version of ionic resources function does not generate all versions, but some icons still exist in config.xml file from old commands.
You can remove all <icon and <splash from config.xml (backup file first) then
ionic cordova resources -f
the command will recreate icons and update config.xml with currently used icon/splash paths.@rodneyjoyce Thanks, sorry! I just wanted to be 100% sure because this issue has been reported on a variety of systems, but the cause seems to be because of a bug in the CLI.
Ah sorry, I implied it, but yes, that build fixed the problem
Downgrade npm uninstall ionic (without -g) npm install ionic@3.12.0 temporary solved problem for me.