m0dch3n / vue-cli-plugin-cordova

Vue Cli 3 Cordova Plugin
MIT License
417 stars 63 forks source link

App does not update on change - Android #69

Closed GMT95 closed 5 years ago

GMT95 commented 5 years ago

Cordova plugin does not update on change in development

The command I am running is below

npm run cordova-serve-android

Is there a way to delete the old cordova build and make new one, I have tried running cordova clean in src-cordova folder but it does'nt work.

m0dch3n commented 5 years ago

is your app pointing to the devserver? have you https enabled? do you see in the terminal console, that the app gets recompiled? is the HMR socket connected?... there could be plenty reasons for this...

m0dch3n commented 5 years ago

can you confirm that the reload is not working on a fresh project?

vue create myapp
cd myapp
vue add cordova
npm run cordova-serve-android

if it's NOT working there, you can reopen this ticket, otherwise check some of the parts above, or compare the differences of your app with the fresh install...

GMT95 commented 5 years ago

I see the app recompile in console but it when I view the result on android emulator it shows old preview of the app, I think the cordova app is not in sync with the vue app, because when I make changes to the vue component it does not reflect in the emulator even after the app has recompiled. Is there a way to make fresh cordova build after deleting the previous one. TIA

m0dch3n commented 5 years ago

I see the app recompile in console but it when I view the result on android emulator it shows old preview of the app, I think the cordova app is not in sync with the vue app, because when I make changes to the vue component it does not reflect in the emulator even after the app has recompiled. Is there a way to make fresh cordova build after deleting the previous one. TIA

For a fresh app ? As mentioned try this:

vue create myapp
cd myapp
vue add cordova
npm run cordova-serve-android

Do you see the default vue app or the default cordova app ? (PS don't run any build command, because this would replace the default cordova app)

If you see the default vue app, check if HOT reload is working on the fresh app...

GMT95 commented 5 years ago

I made new app and it's working perfectly, I think there's a problem with my old app because when I deleted the node modules and ran npm install again it was showing default cordova app. Thanks for the help @m0dch3n, Please tell if there is a way to sync my old app with cordova again.

m0dch3n commented 5 years ago

check if config.xml get's updated to your dev server url, check your webview with "remote devices" in chrome, if it's opening the url, check if the webview connects a socket to the HOT reload system, disable https... there can be plenty reasons...

Another approach (if your old app is no too big), replace the working fresh app slowly part by part, with your old app, and check, when it's stops working...

Anyway, that's all the support I can give you on this issue tracker, because your problem is not related to the plugin, but to vue, android and cordova problems...

Good luck by finding the problem!

PS: If you found it, you can still post the answer here, so others may find hints & ideas too, to track their similar problems...