Cant Generate Resources With ionic cli

I just ran ionic cordova resources with Ionic CLI v3-beta8 successfully.

Did it work for him or not?

Then:

  • Your ionic info output please.
  • What command are you running exactly?
  • Any custom modifications?
  • Anything special about your environment?
  • package.json please.
(14:14:16):~/dev/timepix/timepix-fe (master *+<>)$ ionic info

global packages:

    @ionic/cli-utils : 1.0.0
    Cordova CLI      : 7.0.1
    Ionic CLI        : 3.0.0

local packages:

    @ionic/app-scripts              : 1.3.7
    @ionic/cli-plugin-cordova       : 1.0.0
    @ionic/cli-plugin-ionic-angular : 1.0.0
    Ionic Framework                 : ionic-angular 3.2.0

System:

    Node       : v7.10.0
    OS         : macOS Sierra
    Xcode      : Xcode 8.3.2 Build version 8E2002
    ios-deploy : not installed
    ios-sim    : not installed

(14:13:09):~/dev/timepix/timepix-fe (master *+<>)$ ionic cordova resources
You need to be logged into your Ionic account in order to run ionic cordova resources.
Log into your Ionic account
If you don't have one yet, create yours by running: ionic signup
? Email: ********
? Password: ********
✔ Collecting resource configuration and source images - done!
[ERROR] No platforms have been added. Please run: ionic cordova platform add

(14:14:03):~/dev/timepix/timepix-fe (master *+<>)$ ionic cordova platform add browser
[OK] Platform browser already exists.

and the package.json

{
  "name": "timepix-api",
  "description": "Timepix API",
  "version": "0.1.0",
  "private": true,
  "license": "Commercial",
  "author": "Timepix",
  "engines": {
    "node": "^6"
  },
  "config": {
    "host": "http://localhost",
    "port": "8080",
    "with_services": "true"
  },
  "scripts": {
    "build": "gulp build",
    "clean": "npm prune && gulp clean",
    "create:es-index": "node build/create-es-index.js",
    "delete:es-index": "node build/delete-es-index.js",
    "swagger-ui": "gulp swagger-ui",
    "debug": "gulp debug --script build/app.js",
    "deploy-beta": "gcloud beta app deploy -q build/app.yaml",
    "deploy-gae": "gcloud app deploy -q build/app.yaml",
    "deploy-heroku": "cd build && git init . && heroku git:remote -a timepix-156616 && git add . && git commit -am \"make it better\" && git push heroku master -f && rm -rf .git",
    "deploy": "npm run deploy-gae",
    "gulp": "gulp",
    "lint": "gulp tslint",
    "serve": "npm run serve:web",
    "serve:web": "gulp serve --script build/app.js",
    "start": "node app.js",
    "test": "gulp test",
    "dredd": "dredd $npm_package_config_host:$npm_package_config_port/swagger.yaml $npm_package_config_host:$npm_package_config_port",
    "gulp:dredd": "gulp dredd --script build/app.js",
    "unittest": "gulp unittest",
    "e2etest": "gulp e2etest",
    "preinstall": "npm update",
    "postinstall": "npm prune"
  },
  "dependencies": {
    "@google-cloud/datastore": "^1.0.0",
    "@google-cloud/storage": "^1.0.0",
    "babel-core": "^6.21.0",
    "braintree": "^2.0.2",
    "cache-manager": "^2.2.0",
    "cache-manager-memcached-store": "^2.1.0",
    "data.maybe": "^1.2.2",
    "elasticsearch": "^12.1.3",
    "es6-promisify": "^5.0.0",
    "excel-as-json": "^2.0.0",
    "firebase-admin": "^4.0.6",
    "geodesy": "^1.1.1",
    "get-stream": "^3.0.0",
    "get-uri": "^2.0.0",
    "google-auth-library": "^0.10.0",
    "googleapis": "^19.0.0",
    "gulp-env": "^0.4.0",
    "joi": "^10.1.0",
    "koa": "^1.2.4",
    "koa-cors": "0.0.16",
    "koa-qs": "^2.0.0",
    "koa-router": "^5.4.0",
    "koa-static": "^2.0.0",
    "lodash": "^4.17.2",
    "md5": "^2.2.1",
    "metamagical-interface": "^3.4.0",
    "metamagical-repl": "^0.3.0",
    "moment": "^2.17.0",
    "node-yaml": "^3.0.3",
    "ramda": "^0.23.0",
    "readline": "^1.3.0",
    "request": "^2.79.0",
    "seneca": "^3.2.2",
    "seneca-web": "^2.0.0",
    "seneca-web-adapter-koa1": "^1.0.1",
    "sharp": "^0.17.2",
    "uuid": "^3.0.1",
    "winston": "^2.3.0",
    "winston-elasticsearch": "^0.5.0"
  },
  "devDependencies": {
    "@types/chai": "^3.5.1",
    "@types/geodesy": "^1.1.1",
    "@types/jasmine": "^2.5.41",
    "@types/joi": "^10.0.0",
    "@types/koa": "^2.0.37",
    "@types/lodash": "^4.14.50",
    "@types/node": "^6",
    "@types/request": "^0.0.42",
    "@types/seneca": "^2.1.5",
    "@types/sharp": "^0.17.1",
    "@types/winston": "^2.2.0",
    "chai": "^3.5.0",
    "dredd": "^2.2.5",
    "gulp": "^3.9.1",
    "gulp-clean": "^0.3.2",
    "gulp-cli": "^1.2.2",
    "gulp-istanbul": "^1.1.1",
    "gulp-jasmine": "^2.4.2",
    "gulp-nodemon": "^2.2.1",
    "gulp-replace": "^0.5.4",
    "gulp-run": "^1.7.1",
    "gulp-shell": "^0.6.3",
    "gulp-sourcemaps": "^2.2.0",
    "gulp-tslint": "^8.0.0",
    "gulp-typescript": "^3.1.3",
    "istanbul": "^0.4.5",
    "jasmine": "^2.5.2",
    "jsonfile": "^2.4.0",
    "remap-istanbul": "^0.9.5",
    "run-sequence": "^1.2.2",
    "swagger-ui": "^2.2.10",
    "tslint": "^5.1.0",
    "typescript": "^2.2.2"
  }
}

And you are?

browser is not a platform relevant for resources. Try android or ios.

1 Like

I also faced this problem and solved it by resizing the splash
image

project/resources/splash.png => 2208x2208 to 2732x2732

then again run ionic Cordova resources

I hope this will solve your problem

1 Like

Might be an old topic, but I can’t generate any resources:

Here is a debug from ionic cordova resources --verbose

[DEBUG] CLI flags: { interactive: true, confirm: false }
[DEBUG] { cwd: '/Volumes/Mercury/Development/vouchbase/mobile/promoter', local: false, binPath: 
        '/usr/local/lib/node_modules/ionic/bin/ionic', libPath: '/usr/local/lib/node_modules/ionic/dist/index.js' }
[DEBUG] Daemon found (pid: 798)
[DEBUG] resourceJsonStructure=3
[DEBUG] platformEngines=ios
[DEBUG] buildPlatforms=ios
[DEBUG] getProjectPlatforms completed - length=1
[DEBUG] imgResources=32
[DEBUG] createImgDestinationDirectories completed - length=2
[DEBUG] getSourceImages completed - 2
✔ Collecting resource configuration and source images - done!
✔ Filtering out image resources that do not need regeneration - done!
✖ Uploading source images to prepare for transformations - failed!
HTTP Error 503: POST https://res.ionic.io/api/v1/upload
<!DOCTYPE html>
        <html>
          <head>
                <meta name="viewport" content="width=device-width, initial-scale=1">
                <meta charset="utf-8">
                <title>Application Error</title>
                <style media="screen">
                  html,body,iframe {
                        margin: 0;
                        padding: 0;
                  }
                  html,body {
                        height: 100%;
                        overflow: hidden;
                  }
                  iframe {
                        width: 100%;
                        height: 100%;
                        border: 0;
                  }
                </style>
          </head>
          <body>
                <iframe src="//www.herokucdn.com/error-pages/application-error.html"></iframe>
          </body>
        </html>

Any ideas?

See here: Ionic Resources service is broken

2 Likes

This error can also be due to the change in dimension of project/resources/splash.png => 2208x2208 to 2732x2732.
Please check.

Try to make splash and icon images 2732*2732 and before that go to resources directory and remove them manually then go to your command and run this command :-
“ionic cordova resources -s” to generate splash.
“ionic cordova resources -i” to generate icons.

  1. No, changing the Splash size doesn’t help.
  2. Problem still persists, I’m on Ionic CLI 3.19.0

Did you find a fix for this?

yes. my mistake was photo/image size and type (png). Make sure they are correct and the same everywhere. Otherwise it works perfectly well.

1 Like

thanks. That fixed it for me.

1 Like

Someone can fix it? how? Thx

i have the same problem now, how to fix ?

It turned out to be a issue on Ionic’s server. Not sure what exactly was causing the problem.

It seems that it’s back again…

1 Like

icon size should be 1024x1024, and splash 2732x2732

1 Like

icon size should be 1024X1024, and splash size 3732x3732

I was getting the same error and I think my problem may have been my windows firewall blocking it. Anycase this new flag added to ionic allows it to generate the resources locally so no server request and it worked for me:

npm i -g cordova-res
ionic cordova resources --cordova-res --force
1 Like

I did the test to create a new project and when adding the platform the error is generated (it is trying to generate with the default images)

⠴ Uploading source images to prepare for transformations
HTTP Error 503: POST https://res.ionic.io/api/v1/upload

<html>
  <head>
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<meta charset="utf-8">
	<title>Application Error</title>
	<style media="screen">
	  html,body,iframe {
		margin: 0;
		padding: 0;
	  }
	  html,body {
		height: 100%;
		overflow: hidden;
	  }
	  iframe {
		width: 100%;
		height: 100%;
		border: 0;
	  }
	</style>
  </head>
  <body>
	<iframe src="//www.herokucdn.com/error-pages/application-error.html"></iframe>
  </body>

⠙ Uploading source images to prepare for transformations