Description:
ionic cordova resources
Steps to Reproduce:
ionic cordova resources ios
Output:
✔ Collecting resource configuration and source images - done!
✔ Filtering out image resources that do not need regeneration - done!
✔ Uploading source images to prepare for transformations - done!
✖ Generating platform resources: 18 / 30 complete - failed!
Error: encountered bad status code (400) for https://res.ionic.io/api/v1/transform
body: {"Error":"source image 2208x2208 too small for Default-Landscape@~ipadpro.png, requires at least 2732x2048 source file"}
My ionic info:
[WARN] Error with ./www/lib/ionic/version.json file: FILE_NOT_FOUND, trying ./bower.json.
cli packages: (/Users/mluis/Documents/**SNIP**/node_modules)
@ionic/cli-utils : 1.9.1
ionic (Ionic CLI) : 3.9.1
global packages:
Cordova CLI : 7.0.1
local packages:
Cordova Platforms : ios 4.4.0
Ionic Framework : ionic1 1.1.1
System:
Android SDK Tools : 26.0.2
ios-deploy : 1.9.1
ios-sim : 6.0.0
Node : v6.9.2
npm : 3.10.9
OS : macOS Sierra
Xcode : Xcode 8.3.3 Build version 8E3004b
Other Information:
It should not abort execution but instead throw a message with the information that couldn't generate for that specific target.
Maybe? We do say that "splash screens should ideally be at least 2732×2732px" in the output of ionic cordova resources --help.
If a single image can't be generated for that target, I've seen Cordova error weirdly, perhaps because the entry would still exist in config.xml.
I got two errors on a 2208x2208 image.
The first the message saying should be "2732x2048" then I resized the image to that size.
The other error was saying it should be "2048x2732".
It only stopped when I resized to "2732x2732".
If the entry is in config.xml one can comment out that line for which the image wasn't generated and continue with the process.
Although the information on ionic cordova resources --help is accurate.
We can remove it automatically, too. It's just work that I don't see as very high priority right now.
A lot of those errors are from HTTP responses from a server that hasn't been updated in months. I probably shouldn't be printing them at all.
Backlog then. But at least you know that this happens as it is registered in an issue. :)
Backlogged 😄
@mluis Miguel, você conseguiu alguma solução?
Estou tendo o mesmo problema 😪
@roberthgodoy yes, you need an image "2732x2732" to bypass this.
I have the same problem.
Description of the problem:
PS C:\WorkDaniel\Teste\appstart> ionic cordova resources ios --force --verbose
[DEBUG] Reason for not using local CLI: LOCAL_CLI_NOT_FOUND
[DEBUG] CLI flags: { interactive: true, confirm: false }
[DEBUG] { cwd: 'C:\\WorkDaniel\\Teste\\appstart', local: false, binPath:
'C:\\Users\\SILVA-DANIEL\\AppData\\Roaming\\npm\\node_modules\\ionic\\bin\\ionic', libPath:
'C:\\Users\\SILVA-DANIEL\\AppData\\Roaming\\npm\\node_modules\\ionic\\dist\\index.js' }
[DEBUG] Daemon found (pid: 18020)
[DEBUG] resourceJsonStructure=3
[DEBUG] platforms=android, ios
[DEBUG] buildPlatforms=android, ios
[DEBUG] getProjectPlatforms completed: android, ios
[DEBUG] imgResources=32
[DEBUG] createImgDestinationDirectories completed: 2
[DEBUG] getSourceImages completed: (.\resources\icon.png, .\resources\splash.png)
√ Collecting resource configuration and source images - done!
√ Filtering out image resources that do not need regeneration - done!
[DEBUG] uploadSourceImages completed: responses=[
{},
{}
]
[DEBUG] srcImagesAvailable=[
{
"ext": ".png",
"resType": "icon",
"platform": "global",
"path": "C:\\WorkDaniel\\Teste\\appstart\\resources\\icon.png",
"cachedId": "882b7457ba1a5d72e2db95a839704ed2",
"imageId": "882b7457ba1a5d72e2db95a839704ed2"
},
{
"ext": ".png",
"resType": "splash",
"platform": "global",
"path": "C:\\WorkDaniel\\Teste\\appstart\\resources\\splash.png",
"cachedId": "2f1854e670610de7a33f6ac151c54b7c",
"imageId": "2f1854e670610de7a33f6ac151c54b7c"
}
]
√ Uploading source images to prepare for transformations - done!
× Generating platform resources: 22 / 32 complete - failed!
Error: encountered bad status code (503) for https://res.ionic.io/api/v1/transform
body: <!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>
at Response.res.on (C:\Users\SILVA-DANIEL\AppData\Roaming\npm\node_modules\ionic\node_modules\@ionic\cli-utils\lib\cordova\resources.js:150:32)
at emitNone (events.js:106:13)
at Response.emit (events.js:208:7)
at emitNone (events.js:111:20)
at IncomingMessage.emit (events.js:208:7)
at endReadableNT (_stream_readable.js:1055:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
[DEBUG] Error: encountered bad status code (503) for https://res.ionic.io/api/v1/transform
body: <!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>
at Response.res.on
(C:\Users\SILVA-DANIEL\AppData\Roaming\npm\node_modules\ionic\node_modules\@ionic\cli-utils\lib\cordova\resources.js:150:32)
at emitNone (events.js:106:13)
at Response.emit (events.js:208:7)
at emitNone (events.js:111:20)
at IncomingMessage.emit (events.js:208:7)
at endReadableNT (_stream_readable.js:1055:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
PS C:\WorkDaniel\Teste\appstart> ionic info
cli packages: (C:\Users\SILVA-DANIEL\AppData\Roaming\npm\node_modules)
@ionic/cli-utils : 1.19.2
ionic (Ionic CLI) : 3.20.0
global packages:
cordova (Cordova CLI) : 7.1.0
local packages:
@ionic/app-scripts : 3.1.10
Cordova Platforms : android 6.3.0 ios 4.5.4
Ionic Framework : ionic-angular 3.9.2
System:
Android SDK Tools : 26.1.1
Node : v8.9.4
npm : 4.1.1
OS : Windows 10
Environment Variables:
ANDROID_HOME : C:\Users\SILVA-DANIEL\AppData\Local\Android\Sdk
Misc:
backend : pro
I get the same issue as @SILVA-DANIEL:
Error: encountered bad status code (503) for https://res.ionic.io/api/v1/transform
body:
I have cordova 8
ionic 3.20
this happens when trying to install cordova-android 7. There are no issues when trying to install cordova-android 6.3.0
@SILVA-DANIEL @Sorin-fratila Neither of those issues are the original reported issue.
I'm gonna close this as we now offer a default alternative to the online resource generator in Ionic CLI 5.
Just update to test:
npm i -g ionic@latest
npm i -g cordova-res
ionic cordova resources
Most helpful comment
Backlogged 😄