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

后端 未结 10 1618
栀梦
栀梦 2020-12-29 01:16

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, therefor

相关标签:
10条回答
  • 2020-12-29 01:49

    If you use cordova build, sudo cordova build <platform>

    sudo cordova prepare
    

    at your cordova project root folder.

    this command reflects your changes to builds(all platforms).

    0 讨论(0)
  • 2020-12-29 01:49

    Would like to answer this question as it wasted some real valuable time for me.

    I emptied the platforms folder and build the solution again. BTW, I am using Visual Studio for development. And I should solve the problem.

    Also it is quite obvious but still wanted to reiterate that platforms should not be part of source control.

    Hope it helps.

    0 讨论(0)
  • 2020-12-29 01:54

    I have deleted android-debug.apk from platforms/android/build/outputs/apk and then ionic cordova run android. It worked with no cache.

    0 讨论(0)
  • 2020-12-29 01:57

    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

    0 讨论(0)
  • 2020-12-29 01:57

    Try

    ionic repair
    

    This is a full clean build of all yur packages Official Documentation: https://ionicframework.com/docs/cli/commands/repair

    0 讨论(0)
  • 2020-12-29 02:00

    This might be a bug with Ionic, but to fix it usually I just ctrl+c then gulp and then re-run ionic serve.

    0 讨论(0)
提交回复
热议问题