Ionic 2 : CLI "ionic resources" doesn't generate icon and splashscreen
From @pom421 on July 11, 2016 15:12
Short description of the problem:
When i use the CLI and the command :
$ ionic resources
this is the answer :
(node:8537) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
Ionic icon and splash screen resources generator
uploading icon.png...
uploading splash.png...
When i inspect the generated code, well, it seems that nothing is generated :
- config.xml is not modified
- resources/android/icon (for example) is not updated with the new icons
- platforms/android/res/drawable-hdpi (for example) is not updated too
Same thing for iOS for icon and splash.
Which Ionic Version? 1.x or 2.x
I use ionic 2.0.0-beta.32 on OS X 10.11.4 (El Capitan). I have generated a tutorial project with the CLI like that :
$ ionic start biblio tutorial --v2
Copied from original issue: driftyco/ionic#7269
+1 using v2.0.0-beta35 on Windows machine
OK I finally managed to generate the resources! The problem was on the file format of my custom icon.png and splash.png images. I had them created using powerpoint (save as picture..) with a .png format but they weren't valid. Here are the steps I took and from now on it always works.
- First of all confirm that when you use the default icon.png and splash.png images the ionic resources command works as intended.
- Compare on this site your custom .png files with the defaults respectively. Here is where I got a .png extension for the default files but unknown for my custom ones (some weird characters actually). If the site doesn't work just find another one or simply skip this step.
- In case your custom .png found invalid (unknown extension) convert them here.
- Use the new files and test.
It make sense if ionic's image service validates the .png files before generate the resources. Here's my ionic info.
Cordova CLI: 6.3.0
Gulp version: CLI version 3.9.0
Gulp local: Local version 3.9.1
Ionic Framework Version: 2.0.0-beta.11
Ionic CLI Version: 2.0.0-beta.35
Ionic App Lib Version: 2.0.0-beta.19
OS:
Node Version: v6.2.1
There is some news for this problem?
Thanks @chsakell,
I post this here for future reference.
Mine facing the same issue this afternoon. And somehow my .PNG file not correct (I download them from Web and created/resized them using Preview on Mac) After following @chsakell convert PNG file on web, the ionic resources command work fine again.
Some info: icon.png: 1024x1024 plash.png: 2208x2208 Ionic CLI: 2.0
Cheers!
I also have this issue.
Tried it on Mac in Sudo. Terminal results look successful, but when you go into the folder the old splashscreen images are still there.
I solved it in a not very handy way:
- Delete android/ios/
folders inside resources/ - Be sure your splash image is less than, say, 2500x2500, and compress the image so the filesize is as small as possible. Icon treatment is just the usual.
- Run " ionic resources --icon --force " and " ionic resources --splash --force " TWICE each of them
Hi,
I'm having this issue as well, but it's gotten a little weird for me lately. I generated my assets with support for an iPad Pro at 2732 x 2732 using temp assets; when I was given new assets of the correct dimensions i couldn't generate the new resources until I resized the splash to 2500x2500.
Try downgrading to Cordova 6.2.0.
Looks like this issue is resolved on [email protected]
EDIT: No it is not. The ionic resources command finishes successful, but the big splash screens for iOS and Android are created as empty 0KB files.
This affects the following files:
Default-Landscape@~ipadpro.png
Default-Portrait@~ipadpro.png
drawable-land-hdpi-screen
drawable-port-hdpi-screen
heya this should be a critical bug any news?
I had the same problem until I found out that I needed PROXY as environment variable instead of HTTP_PROXY... A bit strange that when ionic cannot connect to the server to generate the icons it fails silently. I would at least have expected a warning or something.
i was able to generate them by resizing my splash from 2200x2200 to 2000x2000. someone should fix this leaky pot.
Issue from Jul 11, still no fix.
ionic resources --icon works ionic resources -splash does not Sequence looks weird, first it extracts files from the cache, then it uploads the .ai file...
Give us access to the code so we can fix it!
My icons are copyrighted ... could anybody else with the same problem provide their .ai or .psd files (icon/splash) ? @David-Prieto @tryadelion ?
Why do they need our assets?
This shouldn't have a cache at all; executing the commands should mark the cached assets stale prior to the new workflow, so the result is deterministic.
This is a big issue for me too! If the image is too big, it generates the assets in the log and then doesn't copy them into the required places in the resources folder or into config.xml so it must be erroring silently. It would be great to know if any progress is being made on this!
i can't provide icons or splashes, everything copyrighted here.
so basically i think i got splash working by making a full square 2208x2208, which looks weird. different sized (W-H) .psd's don't seem to work, and it didn't even generate the tablet ones.