nativescript-cli icon indicating copy to clipboard operation
nativescript-cli copied to clipboard

`tns livesync android` not updating application consistently

Open brandon-thimmesch opened this issue 10 years ago • 57 comments

I have seen other closed issues reporting similar issues; however, I appear to still be having an issue with tns livesync android. Whenever I run this command it sometimes updates the application and sometimes doesn't. I have run tns livesync android --emulator --watch and had the application refresh with the newly updated code as expected; however, it will randomly stop updating. I will Ctrl-C then re-run tns livesync android --emulator --watch and it won't pick up any changes. I receive no errors, and the application refreshes - just without any changes.

The only fix currently seems to be restarting my computer. I am able to get the expected functionality after this. Help is appreciated, thank you.

brandon-thimmesch avatar Jun 22 '16 18:06 brandon-thimmesch

A very similar CSS error also shows for me, even though I removed all CSS. It only shows if I use the Sass or Less preprocessors, there's no error with plain CSS.

Kobzol avatar Jul 22 '16 11:07 Kobzol

@Bohmaster @jwuliger Im using just plain css not sass/less for my project so i cant even guess where the problem lies.

Im also using angular2

archonik avatar Jul 22 '16 11:07 archonik

I've installed this and now it works. I don't know if it's related.

I'm using angular 2 and I've added "require('nativescript-liveedit)" inside mi main app.ts/js file.

Bohmaster avatar Jul 22 '16 11:07 Bohmaster

@archonik Thank you very much, that seems to have solved the sync issue for me. I just had to do a fullsync first (uninstall app and livesync) and now css, html, js are all synced as expected.

m-abs avatar Jul 22 '16 12:07 m-abs

@m-abs thanks man, its hard trying to prove that NS can hold up to r-n when the most needed thing as livesync does not work properly, glad i helped :).

archonik avatar Jul 22 '16 12:07 archonik

Hi @m-abs , can you explain what you mean by doing a full sync please? I would love to get this to work.

Do you mean to uninstall the android platform and nativescript, then reinstall them again (tns platform add android) and (npm install nativescript -g) ?

Many thanks!

iamnotagit avatar Jul 25 '16 14:07 iamnotagit

@iamnotagit By full sync I mean remove platforms folder and uninstall app from phone/emulator. Don't run npm install nativescript -g you'll remove the fix from @archonik

m-abs avatar Jul 25 '16 22:07 m-abs

If you feel like living on the edge - you can always use the nightly build. It has had the fix it for a little while now. npm install -g http://nativescript.rocks/master/nativescript-cli-master.tgz

jwuliger avatar Jul 25 '16 22:07 jwuliger

Thank you for your guidance @m-abs @jwuliger!

@m-abs I removed (deleted) the 'platform' folder (though, won't this still get built/reproduced again, on save?). I am using the emulator, Genymotion. How would I uninstall the app? Have I correctly understood what it is you are saying?

@jwuliger I installed and had a go at the edge version. It works, in terms of updating CSS changes, though the results/appearance were not consistent between the stable and edge version unfotunately ('SIGN UP' button and font size). I guess that is the nature of 'edge'.

comparison

iamnotagit avatar Jul 26 '16 02:07 iamnotagit

@iamnotagit You uninstall the app just like you would uninstall any other app on an android device. Open settings -> Apps -> find the in the list and tap on it -> tap "uninstall".

m-abs avatar Jul 26 '16 22:07 m-abs

Thanks for the explanation @m-abs! I have managed to get this working!!

iamnotagit avatar Jul 28 '16 09:07 iamnotagit

@jwuliger Thanks again for your suggestion of using the 'edge' version.

I don't believe now that it was because of the 'edge' release that I was getting different CSS results. When using the stable version, I noticed that I would sometimes have this happen as well.

iamnotagit avatar Jul 28 '16 10:07 iamnotagit

@iamnotagit Not a problem. I also have many inconsistencies. I am looking forward to version 2.2!! It looks like it is coming soon :)

jwuliger avatar Jul 28 '16 11:07 jwuliger

This seems to work fine tns livesync android --device 80de14e5 --watch

We need to provide device ID/Index

gazlu avatar Nov 03 '16 17:11 gazlu

I had the same problem, unfortunately with Nativescript version 2.3.0... I created a blank app with ng create and it froze the content of the component (the Tap-button and counter).

I uninstalled the app on the emulator and it works fine again, changes made in the HTML files are being updated again.

Taremeh avatar Nov 11 '16 19:11 Taremeh

I'm using the Android emulator livesync with tns 2.4.2.. Changes to CSS and HTML trigger a weird soft restart which causes some third party plugins to break. Changes to my TypeScript files, however, restart the app correctly with no problems.

Is there a way (in a hook file or elsewhere) to force CSS and HTML to do the same restart as TypeScript files?

zakdances avatar Dec 22 '16 06:12 zakdances

@zakdances we are very interested to know the specifics of this. Which plugins break when CSS/HTML is changed?

valentinstoychev avatar Dec 22 '16 06:12 valentinstoychev