Ionic-cli: ionic cordova build ios gives Error: Source path does not exist: resources/ios/icon/icon-40.png

Created on 22 Sep 2017  ยท  22Comments  ยท  Source: ionic-team/ionic-cli

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 "[email protected]". 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:

  1. Update ionic cli
  2. sudo ionic cordova platform rm ios
  3. sudo ionic cordova platform add ios
  4. 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 [email protected]
    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 [email protected]
    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

needs investigation

Most helpful comment

The root problem is that the resources/ios/icon/icon-40.png image exists as defined in config.xml, but doesn't actually exist on the file system, so Cordova errors.

ionic cordova resources -f should recreate the necessary resources.

All 22 comments

I have the same issue.
Just remove resources, remove platform and try to add platform.

$ 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: .....
                Name: Vitrine QUA
        iOS project created with [email protected]
        Error: Source path does not exist: resources/ios/icon/icon-40.png

Trying to generate resources:

$ 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!
[WARN] Platform already added. Saving platforms to config.xml.
> cordova platform save
โœ” Running command - done!
โœ” Filtering out image resources that do not need regeneration - done!
โœ” Uploading source images to prepare for transformations - done!
โœ” Generating platform resources: 32 / 32 complete - done!
โœ” Modifying config.xml to add new image resources - done!

The bug is related to [email protected].
Downgrading to ionic 3.11.0 - works fine

Looks like it's not related to ionic versions.
Probably problems are on the server which does preparing resources.

how to update the CLI?

@santiagobernalbetancourt
npm i -g ionic@latest

the problem persist... not have updates?

The root problem is that the resources/ios/icon/icon-40.png image exists as defined in config.xml, but doesn't actually exist on the file system, so Cordova errors.

ionic cordova resources -f should recreate the necessary resources.

Change your brackets in config.xml. This solved my problem.

After I removed platforms via CLI and deleted all <platform> along with <icon> and <splash> from my config.xml I was able to add platforms back successfully and build as well.

Still an issue on my system. Any solvings or others with same problem?

Downgrade
npm uninstall ionic (without -g)
npm install [email protected]
temporary solved problem for me.

This was happening for me since I upgraded - looks like it was fixed in [email protected]
https://github.com/ionic-team/ionic-cli/blob/master/CHANGELOG.md

3.13.2 (2017-10-16)
Fixed resources/ directory being excluded in Ionic Package builds.

@rodneyjoyce Can you confirm that fix works for you?

Ah sorry, I implied it, but yes, that build fixed the problem

@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.

I have similar issue:
cordova platform add ios
Using cordova-fetch for cordova-ios@^4.5.4
Adding ios project...
Creating Cordova project for the iOS platform:
Path: platforms/ios
Package: com.rad3.micromanager
Name: BullRush
iOS project created with [email protected]
Error: Source path does not exist: resourcesandroid\icon\drawable-xhdpi-icon.png

Hi @radvansky-tomas ,
Have you solved this problem. I am facing the same issue.

Thanks

Currently getting the same issue:
Whatever I try: removing ios-platform, adding it again, adding resources again. No way works.

But this happens only with an existing project. Creating a new one works without problems.

Ionic Info:
@ionic/cli-utils : 1.19.0
ionic (Ionic CLI) : 3.19.0
global packages:
cordova (Cordova CLI) : 7.1.0
local packages:
@ionic/app-scripts : 3.1.8
Cordova Platforms : ios 4.5.4
Ionic Framework : ionic-angular 3.9.2
System:
ios-deploy : 1.9.2
ios-sim : 5.0.11
Node : v8.9.4
npm : 5.6.0
OS : macOS High Sierra
Xcode : Xcode 9.2 Build version 9C40b

I solved it by creating new project, clean, copy pasted files and then i think added some different ios version...but i dont remember really how

It still remains, how could I solve that? Error: Source path does not exist: resources/ios/icon/[email protected]

POSSIBLE SOLUTIONS
1)I re-ran the build process and mine was solved, seems it was a network issue
2) Try checking if the directory resources/ios/.. exist if not correct it in your config.xml file, some used to be res/ios/...

Pray one of the above work for some

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 ionic cordova resources -f
the command will recreate icons and update config.xml with currently used icon/splash paths.

Was this page helpful?
0 / 5 - 0 ratings