Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to force refresh the cached source files upon Ionic build/run?

I have this random issue with ionic build or ionic run.

I've noticed that during compilation it uses the cache of my source code, therefore when making new changes it doesn't reflect upon re-compiling the app.

So my question is, how can you clear the cache for the build files? I've tried doing ionic state reset but still it doesn't work nor doing uninstall then re-install the app from my Android.

Thanks

like image 879
Rene Padillo Avatar asked Aug 25 '15 06:08

Rene Padillo


3 Answers

What I did to solve my problem was to do re-initialize the Android platform.

ionic cordova platform remove android then ionic cordova platform add android

goto task manager and kill java se process

like image 148
Rene Padillo Avatar answered Nov 13 '22 17:11

Rene Padillo


You need to increment your app version on your config.xml (at the top of your project folder) to reflect your changes before running:

<widget id="com.yourapp.id" version="0.0.8" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"

On this example, increment the attribute version to 0.0.9: version="0.0.9".

Then run android or run ios.

like image 29
Gautier Drusch Avatar answered Nov 13 '22 17:11

Gautier Drusch


Remove platform :

ionic cordova platform rm android

Re add platform :

ionic cordova platform add android

Step 1) copy www folder specific platform

ionic cordova prepare android

Step 2) build apk

ionic cordova build android

Step 3) deploy latest apk in device

ionic cordova run android
like image 8
Khurshid Ansari Avatar answered Nov 13 '22 16:11

Khurshid Ansari