Cant Generate Resources With ionic cli

This is the following error that i’m getting when i try to generate it.

can anyone help me with this Problem?

Generating platform resources Error: encountered bad status code (400) for http://res.ionic.io/api/v1/transform
    at Request.cli_utils_1.createRequest.timeout.type.send.on (C:\Users\elisi\Desktop\AnimeStacks\teamviewer\newMovieStacks\node_modules\@ionic\cli-plu
gin-cordova\dist\lib\resources.js:159:24)
    at emitOne (events.js:96:13)
    at Request.emit (events.js:188:7)
    at Request._emitResponse (C:\Users\elisi\Desktop\AnimeStacks\teamviewer\newMovieStacks\node_modules\superagent\lib\node\index.js:745:10)
    at ClientRequest.<anonymous> (C:\Users\elisi\Desktop\AnimeStacks\teamviewer\newMovieStacks\node_modules\superagent\lib\node\index.js:360:10)
    at ClientRequest.g (events.js:291:16)
    at emitOne (events.js:101:20)
    at ClientRequest.emit (events.js:188:7)
    at HTTPParser.parserOnIncomingClient (_http_client.js:473:21)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:99:23)

thanks

Chris

2 Likes

This sounds like a server side error on the webservice from Ionic that is used to transform the images. Just try again maybe?

If it doesn’t work, try to intercept the request with a proxy (Charles Web Proxy or similar) and look at what error you are actually getting with this status code 400.

i try with another proxy and get same error

You aren’t connecting to the web directly?

i had a friend try it from a different location i still get the same problem.

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.