v3beta7 - Error: encountered bad status code (400) - When generating resources
v3 beta7 testing
Please ensure that you are on the latest version of the CLI.
npm view ionic@latest version
2.2.2
What version of the CLI are you using? Output of ionic --version
3.0.0-beta7
Short description of the problem:
Getting the below error when generating resources on iOS
You need to be logged into your Ionic account in order to run the cordova:resources command.
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!
✔ Uploading source images to prepare for transformations - done!
⠹ 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 (/Users/proj/app/node_modules/@ionic/cli-plugin-cordova/dist/lib/resources.js:159:24)
at emitOne (events.js:96:13)
at Request.emit (events.js:191:7)
at Request._emitResponse (/Users/proj/app/node_modules/superagent/lib/node/index.js:745:10)
at ClientRequest.<anonymous> (/Users/proj/app/node_modules/superagent/lib/node/index.js:360:10)
at Object.onceWrapper (events.js:293:19)
at emitOne (events.js:101:20)
at ClientRequest.emit (events.js:191:7)
at HTTPParser.parserOnIncomingClient (_http_client.js:522:21)
at HTTPParser.parserOnHeadersComplete (_http_common.js:99:23)
What behavior are you expecting?
Generation of resources without errors
Steps to reproduce:
- run ionic cordova resources on iOS
I have also ran these commands AGAIN still same error
npm install -g ionic@beta
npm install --save-dev @ionic/cli-plugin-ionic-angular@beta @ionic/cli-plugin-cordova@beta
if u try ionic cordova resources -i it should work, but the ionic cordova resources -s does not work for me either
we got the same issue
⠹ Generating platform resources: 41 / 48 complete Error: timeout of 30000ms reached for http://res.ionic.io/api/v1/transform
May be related to https://github.com/driftyco/ionic-cli/issues/2118
@zoinkydoink @orlyapps Are you using custom resources?
@dwieeb I am not sure what you mean by "custom" I have a splash.png and icon.png in the resource folder and those images are made by my designer, meaning they are custom logos if that is what you mean.
Also do you know when we are to expect next beta?
We dont also use any "custom" icon. Same as @zoinkydoink Workarround:
- uninstall ionic beta
- install stable ionic
- call ionic resources
- uninstall ionic
- install stable ionic beta
😄
btw: splash.png is 2732x2732px
@orlyapps what is the command to uninstall betas and how do you pick which is the ionic stable? This issue has been a show stopper for me
Until yesterday I got same error when run ionic cordova resources
I could generate the icons resources successfully passing --icon to ionic cordova resources --icon command.
But I got error generating the splash resources passing --splash:
✔ Collecting resource configuration and source images - done!
✔ Uploading source images to prepare for transformations - done!
⠹ Generating platform resources Error: encountered bad status code (400) for http://res.ionic.io/api/v1/transform
But today I got a different error both with parameters --icon and --splash to ionic cordova resources command:
$ ionic cordova resources
✔ Collecting resource configuration and source images - done!
⠸ Uploading source images to prepare for transformations HTTP Error 503: POST http://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>
What version of the CLI are you using? Output of ionic --version 3.0.0-beta7
For now I also am using the workaround like @orlyapps: @zoinkydoink Here are the commands. Follow the steps below:
npm -g uninstall ionic@beta
npm -g install ionic
ionic resources
npm -g uninstall ionic
npm -g install ionic@beta
This has been fixed and beta8 will be out soon! Thank you!
Change file dimensions,
project/resources/splash.png => 2208x2208 to 2732x2732
Run: ionic cordova resources
^ Correct. For existing projects, you will need a splash image with dimensions 2732x2732. Here is the default splash image: https://raw.githubusercontent.com/driftyco/ionic2-app-base/master/resources/splash.png
New projects will have the new default splash image.
@niojihy @dwieeb It's solved my problem. I have a existing v2 project and my splash had a dimension of 2208x2208. I changed splash dimensions to 2732x2732 and re-ran ionic cordova resources, everything works fine now.
I've 2732x2732 dimensions in IONIC V1 project. But the problem still exists.
@ahayder You may get the timeout on a slow connection because the image has to be fully uploaded and then transformed during the request. There's nothing we can do right now about the 30s server timeout.
Be sure to don't try to send your .psd file which are often heavier than your png file. After that delete the .md5, then try again. That did the trick for me
Had the same issue, what work for me was to reduce the image size on disk, compressed it with tinypng, went from 3mb to 900k and it work after that
On ionic 3.12.0, I am getting one of the errors mentioned above: "uploading source images to prepare for transformations HTTP Error 503: POST http://res.ionic.io/api/v1/upload" etc., etc. So I must be doing something wrong, or it wasn't fixed?
@solumyr - there was a server issue earlier. It appears to be cleared up now. Can you give this another try?
Works, thanks!