Ionic-cli: ionic cordova resources not working

Created on 26 May 2017  Â·  21Comments  Â·  Source: ionic-team/ionic-cli

Short description of the problem:

While runningionic cordova resources android, the icons are not generated. Instead I'm getting the following error.

[WARN] Error occurred during command execution from a CLI plugin (@ionic/cli-plugin-cordova). Your plugins may be out of date.
✖ Collecting resource configuration and source images - failed!
Error: Source image files were not found for the following platforms/types:

I have updated ionic to the latest version and all the plugins are updated as well. I followed this documentation. Here is my package.json file

{
  "name": "my-app",
  "version": "0.0.1",
  "author": "Ionic Framework",
  "homepage": "http://ionicframework.com/",
  "private": true,
  "scripts": {
    "clean": "ionic-app-scripts clean",
    "build": "ionic-app-scripts build",
    "lint": "ionic-app-scripts lint",
    "ionic:build": "ionic-app-scripts build",
    "ionic:serve": "ionic-app-scripts serve"
  },
  "dependencies": {
    "@angular/common": "4.1.2",
    "@angular/compiler": "4.1.2",
    "@angular/compiler-cli": "4.1.2",
    "@angular/core": "4.1.2",
    "@angular/forms": "4.1.2",
    "@angular/http": "4.1.2",
    "@angular/platform-browser": "4.1.2",
    "@angular/platform-browser-dynamic": "4.1.2",
    "@ionic-native/core": "3.10.2",
    "@ionic-native/splash-screen": "3.10.2",
    "@ionic-native/status-bar": "3.10.2",
    "@ionic/cli-plugin-cordova": "^1.2.1",
    "@ionic/storage": "2.0.1",
    "cordova-android": "^6.2.3",
    "cordova-plugin-console": "^1.0.5",
    "cordova-plugin-device": "^1.1.4",
    "cordova-plugin-splashscreen": "^4.0.3",
    "cordova-plugin-statusbar": "^2.2.2",
    "cordova-plugin-whitelist": "^1.3.1",
    "ionic-angular": "3.3.0",
    "ionic-plugin-keyboard": "^2.2.1",
    "ionicons": "3.0.0",
    "rxjs": "5.1.1",
    "sw-toolbox": "3.6.0",
    "zone.js": "0.8.11"
  },
  "devDependencies": {
    "@ionic/app-scripts": "1.3.7",
    "@ionic/cli-plugin-cordova": "1.2.1",
    "@ionic/cli-plugin-ionic-angular": "1.2.0",
    "typescript": "2.3.3"
  },
  "description": "An Ionic project",
  "cordova": {
    "plugins": {
      "cordova-plugin-console": {},
      "cordova-plugin-device": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-statusbar": {},
      "cordova-plugin-whitelist": {},
      "ionic-plugin-keyboard": {}
    },
    "platforms": [
      "android"
    ]
  }
}

* The output of ionic info is as follows*

global packages:

    @ionic/cli-utils : 1.2.0
    Cordova CLI      : 7.0.1 
    Ionic CLI        : 3.2.0

local packages:

    @ionic/app-scripts              : 1.3.7
    @ionic/cli-plugin-cordova       : 1.2.1
    @ionic/cli-plugin-ionic-angular : 1.2.0
    Cordova Platforms               : android 6.2.3
    Ionic Framework                 : ionic-angular 3.3.0

System:

    Node       : v6.6.0
    OS         : macOS Sierra
    Xcode      : Xcode 8.0 Build version 8A218a 
    ios-deploy : 1.8.4 
    ios-sim    : 5.0.2 

Kindly share some pointers on the same.

Most helpful comment

Ah my problem was something stupid on my part. The resources directory only contained empty folders. Downloading this repo and replacing the resources directory then running ionic cordova resources solved my issue.

All 21 comments

Same result if you just run ionic cordova resources?
Try also running `ionic cordova resources --verbose'.

I have the exact same problem right now. I am running ionic cordova resources and receiving this output

 [WARN] Error occurred during command execution from a CLI plugin (@ionic/cli-plugin-cordova). Your plugins may be out of date.
✖ Collecting resource configuration and source images - failed!
Error: Source image files were not found for the following platforms/types:

Running ionic cordova resources --verbose shows this:

[DEBUG] Load global plugin @ionic/cli-plugin-proxy
[DEBUG] Throwing PLUGIN_NOT_INSTALLED for global @ionic/cli-plugin-proxy
[DEBUG] Load local plugin @ionic/cli-plugin-cordova
[DEBUG] Load local plugin @ionic/cli-plugin-ionic-angular
[DEBUG] resourceJsonStructure=3
[DEBUG] platformDirContents=android
[DEBUG] buildPlatforms=android
[DEBUG] getProjectPlatforms completed - length=1
[DEBUG] imgResources=18
[DEBUG] createImgDestinationDirectories completed - length=2
[DEBUG] getSourceImages completed - 0
[WARN] Error occurred during command execution from a CLI plugin (@ionic/cli-plugin-cordova). Your plugins may be out of date.
[DEBUG] !!! ERROR ENCOUNTERED !!!
✖ Collecting resource configuration and source images - failed!
Error: Source image files were not found for the following platforms/types:

[DEBUG] Error: Source image files were not found for the following platforms/types:

            at ResourcesCommand.<anonymous> (C:\Users\Phil\code\Documents\myApp\node_modules\@ionic\cli-plugin-cordova\dist\commands\resources.js:103:23)
            at next (native)
            at fulfilled (C:\Users\Phil\code\Documents\myApp\node_modules\@ionic\cli-plugin-cordova\dist\commands\resources.js:10:58)

My ionic info

global packages:

    @ionic/cli-utils : 1.2.0
    Cordova CLI      : 7.0.1
    Ionic CLI        : 3.2.0

local packages:

    @ionic/app-scripts              : 1.3.0
    @ionic/cli-plugin-cordova       : 1.2.1
    @ionic/cli-plugin-ionic-angular : 1.2.0
    Cordova Platforms               : android 6.2.3
    Ionic Framework                 : ionic-angular 3.0.1

System:

    Node       : v6.10.3
    OS         : Windows 10
    Xcode      : not installed
    ios-deploy : not installed
    ios-sim    : not installed

Ah my problem was something stupid on my part. The resources directory only contained empty folders. Downloading this repo and replacing the resources directory then running ionic cordova resources solved my issue.

Mack sure that The resources directory contained (icon & splash) rename your icon to icon.png or icon.psd and the splash to splash.png or splash.psd

I have the same issue now:

Igors-MacBook-Pro:Archive igorkhomenko$ ionic cordova resources ios --verbose
[DEBUG] Loading global plugin @ionic/cli-plugin-proxy
[DEBUG] Throwing PLUGIN_NOT_INSTALLED for global @ionic/cli-plugin-proxy
[DEBUG] Loading local plugin @ionic/cli-plugin-cordova
[DEBUG] Loading local plugin @ionic/cli-plugin-ionic-angular
[DEBUG] Loading local plugin @ionic/cli-plugin-proxy
[DEBUG] resourceJsonStructure=3
[DEBUG] platformDirContents=ios
[DEBUG] buildPlatforms=ios
[DEBUG] getProjectPlatforms completed - length=1
[DEBUG] imgResources=30
[DEBUG] createImgDestinationDirectories completed - length=2
[DEBUG] getSourceImages completed - 0
[WARN] Error occurred during command execution from a CLI plugin (@ionic/cli-plugin-cordova). Your plugins may be out of date.
[DEBUG] !!! ERROR ENCOUNTERED !!!
✖ Collecting resource configuration and source images - failed!
Error: Source image files were not found for the following platforms/types: 

[DEBUG] Error: Source image files were not found for the following platforms/types: 

            at ResourcesCommand.<anonymous> (/Users/igorkhomenko/Downloads/Archive/node_modules/@ionic/cli-plugin-cordova/dist/commands/resources.js:104:23)
            at next (native)
            at fulfilled (/Users/igorkhomenko/Downloads/Archive/node_modules/@ionic/cli-plugin-cordova/dist/commands/resources.js:10:58)

the same happens when I run ionic cordova resources only

I have tried what @philipgriffin suggested with resources dir replacement and it works!
thanks

This is mostly just bad error messaging on our part. It looks like a disastrous error, but it's supposed to be informational. I've fixed this.

@philipgriffin nice Thank You......

Facing a similar issue while trying to build for platform android

[WARN] Error occurred during command execution from a CLI plugin (@ionic/cli-plugin-cordova). Your plugins may be out of
       date.
Error: Invalid character in entity name
Line: 4
Column: 64
Char: 

package.json

{
    "name": "biznet-mobile-app",
    "version": "0.0.1",
    "author": "Mujtaba Nowshad & EON InfoSys Team.",
    "homepage": "http://ionicframework.com/",
    "private": true,
    "scripts": {
        "clean": "ionic-app-scripts clean",
        "build": "ionic-app-scripts build",
        "lint": "ionic-app-scripts lint",
        "ionic:build": "ionic-app-scripts build",
        "ionic:serve": "ionic-app-scripts serve"
    },
    "dependencies": {
        "@angular/common": "4.1.3",
        "@angular/compiler": "4.1.3",
        "@angular/compiler-cli": "4.1.3",
        "@angular/core": "4.1.3",
        "@angular/forms": "4.1.3",
        "@angular/http": "4.1.3",
        "@angular/platform-browser": "4.1.3",
        "@angular/platform-browser-dynamic": "4.1.3",
        "@ionic-native/core": "3.10.2",
        "@ionic-native/http": "^3.12.1",
        "@ionic-native/splash-screen": "3.10.2",
        "@ionic-native/status-bar": "3.10.2",
        "@ionic/storage": "2.0.1",
        "cordova-android": "^6.2.3",
        "cordova-plugin-compat": "^1.1.0",
        "cordova-plugin-console": "^1.0.5",
        "cordova-plugin-device": "^1.1.4",
        "cordova-plugin-file": "^4.3.3",
        "cordova-plugin-http": "^1.2.0",
        "cordova-plugin-splashscreen": "^4.0.3",
        "cordova-plugin-statusbar": "^2.2.2",
        "cordova-plugin-whitelist": "^1.3.1",
        "ionic-angular": "3.4.2",
        "ionic-plugin-keyboard": "^2.2.1",
        "ionicons": "3.0.0",
        "rxjs": "5.4.0",
        "sw-toolbox": "3.6.0",
        "zone.js": "0.8.12"
    },
    "devDependencies": {
        "@ionic/app-scripts": "1.3.7",
        "@ionic/cli-plugin-cordova": "1.4.0",
        "@ionic/cli-plugin-ionic-angular": "1.3.1",
        "typescript": "2.3.3"
    },
    "description": "An Ionic project",
    "cordova": {
        "plugins": {
            "cordova-plugin-http": {},
            "cordova-plugin-console": {},
            "cordova-plugin-device": {},
            "cordova-plugin-splashscreen": {},
            "cordova-plugin-statusbar": {},
            "cordova-plugin-whitelist": {},
            "ionic-plugin-keyboard": {}
        },
        "platforms": [
            "android"
        ]
    }
}

ionic info:

global packages:

    @ionic/cli-utils : 1.4.0
    Cordova CLI      : 7.0.1 
    Ionic CLI        : 3.4.0

local packages:

    @ionic/app-scripts              : 1.3.7
    @ionic/cli-plugin-cordova       : 1.4.0
    @ionic/cli-plugin-ionic-angular : 1.3.1
    Cordova Platforms               : android 6.2.3
    Ionic Framework                 : ionic-angular 3.4.2

System:

    Node       : v6.9.4
    OS         : Linux 4.2
    Xcode      : not installed
    ios-deploy : not installed
    ios-sim    : not installed
    npm        : 4.1.1 

@iLGunners Sound more like a support/usage issue, please post at https://forum.ionicframework.com/

happened the same to me when i started a project Super, then i try to run it in android and this appears
[WARN] Error occurred during command execution from a CLI plugin
(@ionic/cli-plugin-cordova). Your plugins may be out of date.
Error: Failed to transpile program

@ggabooo What exactly happened to you too? The error you describe sounds totally different from what this issue talked about yet (but also would best be solved at https://forum.ionicframework.com/ probably, not in an issue).

I'm facing a similar issue.

ionic cordova resources --verbose
[DEBUG] CLI flags: { interactive: true, confirm: false }
[DEBUG] { cwd: '/Users/mobile', local: true, binPath:
        '/usr/local/lib/node_modules/ionic/bin/ionic', libPath:
        '/Users/mobile/node_modules/ionic/dist/index.js' }
[DEBUG] Daemon found (pid: 26015)
[DEBUG] resourceJsonStructure=3
[DEBUG] platformEngines=[object Object]
[DEBUG] buildPlatforms=ios
[DEBUG] getProjectPlatforms completed - length=1
[DEBUG] imgResources=30
[DEBUG] createImgDestinationDirectories completed - length=2
[DEBUG] getSourceImages completed - 2
[ERROR] Source image files were not found for the following platforms/types: ios/splash

Running ionic cordova resources right after creating a brand new project with ionic start

EDIT: I'm a dorko, and had my file named Splash.png not splash.png.

@sean-hill You should open a new issue on this. Your error message is different. Include all the necessary information you see in the issue template. THanks.

'ionic cordova resources' command is not working! it asks for a login but i cant login my account through CLI?

image

screenshot 2017-09-21 15 09 19

That is not an issue for Github, especially not for hijacking an old, closed one.

Post your problem at https://forum.ionicframework.com/ and/or read this: https://ionic.zendesk.com/hc/en-us/articles/115011945607-Unable-to-log-in-using-the-CLI

I was having issues generating the splash screen and icon for ios.
Whenever I ran ionic cordova resources, it will just recreate the resources for android but wouldn't do the same for ios.

I simply deleted all the pngs from icon and splash folder of ios and ran ionic cordova resources ios and it worked.
In similar fashion, it should work for Android too.

Ah my problem was something stupid on my part. The resources directory only contained empty folders. Downloading this repo and replacing the resources directory then running ionic cordova resources solved my issue.

Fixed mine too

if you have an existing resource folder in another project for ionic
copy it and paste it to the new project

For anyone who is having this issue, make sure the icon and splash screen file names are in "lowercase"

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

The latest solution. It works for me.

The source icons should ideally be at least 1024×1024px and located at resources/icon.png.
The source image for splash screens should ideally be at least 2732×2732px and located at resources/splash.png.

Was this page helpful?
0 / 5 - 0 ratings