Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ionic resources does NOT update old icon #420

Closed
perrygovier opened this issue May 13, 2015 · 173 comments
Closed

ionic resources does NOT update old icon #420

perrygovier opened this issue May 13, 2015 · 173 comments
Assignees

Comments

@perrygovier
Copy link
Contributor

From @sclearion on May 13, 2015 20:29

ionic resources does not work as documented. It keeps loading from "cache". how can i remove this stupid caching as it is driving the graphic designers crazy. I have followed docs to a T and the only way I can update the icon is by removing android platform and re-installing.

Copied from original issue: ionic-team/ionic-framework#3723

@adamdbradley
Copy link

@cesarvega Before the resources server knows to use the images cache or not, it does a checksum on the source image. If the checksum of the source image is the same then it'll pull the image from the cache, if not, I'll it'll upload a new image again. Are you replacing the source image each time?

@jbavari
Copy link

jbavari commented May 14, 2015

@cesarvega - I'm trying this right now with latest (1.4.0). If I change my icon/splashscreen colors and run the resources command, it recreates the images. If I try to use the old ones, it relies on caching.

What is your use case here? Are you trying to fetch those resources for another machine by re-running the resources command?

@jbavari jbavari self-assigned this May 14, 2015
@sclearion
Copy link

Nope it's the same machine. I update (change colors, bevel, gradients) the icon with GIMP, run the resources tool and see that it does not pull from cache...GREAT. Afterwards when I search the platform/ and resources/ folders for the new icon.png, the old one is still there and the new one only gets added to the drawable folder.

Anyways, I created a D script that would remove all stale icon and splash images from platform/ and resources/ and then it runs 'ionic resources'. Works great for now.

Thanks for the help and feedback

@sclearion
Copy link

I just really want to know if there is a simple 'no-cache' option. I can deal with the images not updating.

@jbavari
Copy link

jbavari commented May 19, 2015

I think I understand the problem more.

Are you meaning the images that are copied over to the platforms?

Have you tried just running ionic platform rm ios && ionic platform add ios? That would have it copy over the files in the meantime.

@mzarella
Copy link

mzarella commented Jun 9, 2015

rm -rf resources/ios
rm -rf resources/android

ionic resources

...it still still uses cached images...

where are these cached images... I would like to remove them so this operates correctly

@sclearion
Copy link

My hack method: Search resources/android for .png's in file browser (im on Ubuntu) then manually delete all old icons/splash you see. THEN run ionic resources. Works great for now. WHY would you cache images on a development platform when they are most likely going to be updated VERY frequently. Other than that, I LOVE THIS FRAMEWORK.

@dineshgh
Copy link

On Mac, "ionic resources --icon" generates the icons but these don't get picked up Xcode. As a result, the app still shows ionic icon and splash. It works for android (using Windows).

After "ionic resources --icon" I get a bunch of png files in $appdir/resources/ios/icon/ that are current; I also see in $appdir/config.xml the icon tags for platform name="ios". How do I get them into Xcode and into my app? Thanks.

@jfcisternasm
Copy link

Hi, on Windows you can clean system temp files with ccleaner tool and ionic resources generates new splash and icons for your app.

Sorry for my english, i am from Chile.

@nicky-song
Copy link

Caching resources has been really an annoying feature since I've been using Ionic. Please please and please kindly remove this feature.

@konkissner
Copy link

Today, sth. really annoying happened:
One of the screen.png of Androids' resources was corrupted, which caused an error when building the apk.

Because of the server-side cache / checksum-check, i always got the corrupted images when running ionic resources, although I deleted the resources/ios and resources/android folder.

Editing the source-file (to change its checksum) solved the problem…

An option to ignore / delete the cache when running ionic resources would be great…

@migaes
Copy link

migaes commented Sep 21, 2015

So annoying that's true, an option like ionic resources --clean-cache needed. What @ehlerskon says works for me.

@rdmclin2
Copy link

Me,too,same problem

@sghribi
Copy link

sghribi commented Oct 21, 2015

Thks @ehlerskon

And +1 for --clean-cache option :)

@s1lviu
Copy link

s1lviu commented Oct 27, 2015

Same problem on Mac!

Edit: I have solved by placing the "icon.png" in the resources folder. (I have placed it on the project's root folder).

@westonganger
Copy link

+1 for --clean-cache option

@luizsoliveira
Copy link

I have solved running the command "ionic prepare ios"

@eliashdezr
Copy link

So, is there an option available to ignore cache?

@shi11
Copy link

shi11 commented Nov 6, 2015

+1 - how was this overlooked? rm platform ios is not a solution.

@VipinAgarwal
Copy link

This is driving crazy.. we need some switch to remove cache.

@adrianboisclair
Copy link

I'm having this same issue. I'm not sure what to do right now since I'm trying to release my app to the App Store and the dang icon is looking crazy! hahaha This is insane.

@luizsoliveira
Copy link

Do you already tried the following command:

ionic prepare ios
Em 16/11/2015 16:00, "Adrian Boisclair" notifications@github.com escreveu:

I'm having this same issue. I'm not sure what to do right now since I'm
trying to release my app to the App Store and the dang icon is looking
crazy! hahaha This is insane.


Reply to this email directly or view it on GitHub
#420 (comment).

@HelloYu
Copy link

HelloYu commented Nov 18, 2015

Hey guys, I recommend you try this, go 'C:\Users\AppData\Local\Temp ' this temp directory, and delete the cache files , then try again .

@ddeabreu
Copy link

Easy Trick : Create a new blank project, add your splash & icon.psd in /resources, execute sudo ionic resources then copy all news generated files in your current project ;) Quick & easy :)
<3 Ionic

@troyanskiy
Copy link

+1 for --clean-cache option

@AzrizHaziq
Copy link

AzrizHaziq commented Dec 6, 2016

Some how i manage to fix this by manually copy the generated file on res folder, one by one to corresponding folder in platforms/android/res and rename it

im using

Your system information:

Cordova CLI: 6.4.0
Gulp version:  CLI version 1.2.2
Gulp local:   Local version 3.9.1
Ionic Framework Version: 1.3.1
Ionic CLI Version: 2.1.4
Ionic App Lib Version: 2.1.2
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Mac OS X El Capitan
Node Version: v6.9.1
Xcode version: Xcode 8.1 Build version 8B62

@msegers
Copy link

msegers commented Dec 6, 2016 via email

@RZR666
Copy link

RZR666 commented Dec 7, 2016

I've been having this issue all day, glad I'm not the only one experiencing it but since it's a year old, I doubt it'll be fixed anytime soon.

@agpt
Copy link

agpt commented Dec 7, 2016

Using ionic cli v2.1.13.
OS: Ubuntu 16.0.4 LTS
Node: V6.7.0

still facing this issue. All I did was manually overwriting the files from res folder to platforms/android/res. no other solution worked for me, not even --clean-cache. any other cleaner solution ?

@tskweres
Copy link

tskweres commented Dec 7, 2016

@agupta-q4 for now I would write a custom gulp task that includes ionic build android and then copies and replaces the res folder to the proper place.

Then instead of doing ionic build android, just run gulp build-android or something like that which fires off your task

gulp.task('move-android-res', false, function(cb) {
    exec('[ -d "res" ] && cp -R res platforms/android && rm -R res || echo "Error: Directory res does not exists." ',
    function(err) {
        cb(err);
    });
});

@PabloFNK
Copy link

I think that @tomysmile has found the way to fix it at the moment, this is a Cordova bug and not Ionic specific:

Cordova released a fix for this one month ago for the Android platform but for some reason the cordova-cli is still using an old version of the Android platform that hasn't the problem fixed.

So, the steps:

$ ionic platform rm android
$ ionic platform add android
$ ionic platform update android@6.1.0

You can see that by default cordova is adding as android platform version the 6.0.0 but the bug is fixed in the 6.1.0 (https://github.com/apache/cordova-android/blob/master/RELEASENOTES.md).

Remove and add the platform can be avoided, I've added them for the people that had copy/pasted the icon and splashcreen to the platform folder, if you haven't done that the third step would be enough.

@tore90turris
Copy link

@PabloFNK Thx

$ ionic platform rm android
$ ionic platform add android
$ ionic platform update android@6.1.0

Now the icon is working correctly, but still do not see the splash screen, showing the white screen

Cordova CLI: 6.4.0
Ionic Framework Version: 1.3.1
Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.0.0-beta.20
OS:
Node Version: v6.9.1

@PabloFNK
Copy link

@tore90turris are you following correctly all the steps (http://blog.ionic.io/automating-icons-and-splash-screens/)?

Both, icon and splashscreen is working now to me.

@tore90turris
Copy link

tore90turris commented Dec 12, 2016

@PabloFNK
Yes, launch ionic resources --splash
This is my config.xml

<platform name="android">
    <allow-intent href="market:*"/>
    <icon src="resources\android\icon\drawable-ldpi-icon.png" density="ldpi"/>
    <icon src="resources\android\icon\drawable-mdpi-icon.png" density="mdpi"/>
    <icon src="resources\android\icon\drawable-hdpi-icon.png" density="hdpi"/>
    <icon src="resources\android\icon\drawable-xhdpi-icon.png" density="xhdpi"/>
    <icon src="resources\android\icon\drawable-xxhdpi-icon.png" density="xxhdpi"/>
    <icon src="resources\android\icon\drawable-xxxhdpi-icon.png" density="xxxhdpi"/>
    <splash src="resources\android\splash\drawable-land-ldpi-screen.png" density="land-ldpi"/>
    <splash src="resources\android\splash\drawable-land-mdpi-screen.png" density="land-mdpi"/>
    <splash src="resources\android\splash\drawable-land-hdpi-screen.png" density="land-hdpi"/>
    <splash src="resources\android\splash\drawable-land-xhdpi-screen.png" density="land-xhdpi"/>
    <splash src="resources\android\splash\drawable-land-xxhdpi-screen.png" density="land-xxhdpi"/>
    <splash src="resources\android\splash\drawable-land-xxxhdpi-screen.png" density="land-xxxhdpi"/>
    <splash src="resources\android\splash\drawable-port-ldpi-screen.png" density="port-ldpi"/>
    <splash src="resources\android\splash\drawable-port-mdpi-screen.png" density="port-mdpi"/>
    <splash src="resources\android\splash\drawable-port-hdpi-screen.png" density="port-hdpi"/>
    <splash src="resources\android\splash\drawable-port-xhdpi-screen.png" density="port-xhdpi"/>
    <splash src="resources\android\splash\drawable-port-xxhdpi-screen.png" density="port-xxhdpi"/>
    <splash src="resources\android\splash\drawable-port-xxxhdpi-screen.png" density="port-xxxhdpi"/>
  </platform>
  <engine name="android" spec="~6.0.0"/>
  <icon src="resources\android\icon\drawable-xhdpi-icon.png"/>
  <preference name="SplashScreen" value="screen"/>
  <preference name="SplashScreenDelay" value="3000"/>

@rolandjitsu
Copy link

Is there a reason why there is a res and resources folder now? Or is this just a bug?

@petewarrior
Copy link

@rolandjitsu Apparently that res folder should be inside platforms/android. Just overwrite the one already there.

@MoisesValera
Copy link

+1 for ionic resources --clean-cache

@zhantewei2
Copy link

thanks for PabloFNK and Elijax

@theunreal
Copy link

I put my splash.png inside my res/ folder, ran --clean-cache, but the splash images inside my android folder stays the same. what's wrong?

@AzrizHaziq
Copy link

@theunreal , have u try to run this on your terminal.

$ ionic platform rm android
$ ionic platform add android
$ ionic platform update android@6.1.0

@saeed68gm
Copy link

Finally the update command did the trick for me

@ppiatek
Copy link

ppiatek commented Jan 6, 2017

I had problem like this when I removed and added platform android.
I saw that in folder platforms/android/res there were default splashscreen's images. When I overwrited them splashscreen was updated in application.
These is not correct way to fix it because I shouldn't touch manualy folder /platform/ but I hope that someone find solution how to do that in command line and will write it below.

@rahianeja
Copy link

For me re installing cordova and ionic using npm install -g cordova and npm install -g ionic (on latest update released) - removing and readding platforms works.

@kapposds
Copy link

@ubaidseth finally that works!!!!!!!!! +1

@shah-smit
Copy link

+1 @bormansquirrel for ionic resources --clean-cache;

@abdulsalam944
Copy link

Just delete files from your temp folder of windows, then run "ionic resources" command again. ionic will re-upload and generate new images.

@jrbistuer
Copy link

jrbistuer commented Jan 19, 2017

In my case it worked updating the platform

$ ionic platform update android@6.1.0

@lakehouseru
Copy link

On osX.

  1. Find the temp folder
    echo $TMPDIR
  2. Delete all images in it
  3. Generate resources.
  4. Voila!

@PabloFNK
Copy link

As @rahianeja said since 17th January (Cordova released version 6.5.0) it is using the last version of cordova-android with the bug fixed, so, it's no longer needed the 'update' trick.

Just update Cordova to the latest version and finally remove and add the platform.

@scvishnu7
Copy link

scvishnu7 commented Jan 30, 2017

I have to copy all the directories from 'res' directory on project root to platform/android/res .
It is wired.

Note: ionic platform rm android and ionic platform add android didn't solvevd it

@sarment0
Copy link

Still not working... i tried cleaning the $TMPDIR and removed the platform and add again.

Mac OSX.

@jthoms1
Copy link
Contributor

jthoms1 commented Jan 31, 2017

I am actively working on our implementation of CLI v3. I did a ground up rewrite and can tell you that the caching issues are fixed. We will be releasing this in the coming weeks. Right now I am going to lock this issue.

@ionic-team ionic-team locked and limited conversation to collaborators Jan 31, 2017
@imhoffd imhoffd closed this as completed Jul 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests