nativescript-cli: `tns livesync android` not updating application consistently
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.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 3
- Comments: 57 (10 by maintainers)
I know several people having this issue and is stopping us from developing with smooth and ease applications in nativescript.
Please someone help us! I love nativescript but I cant run “tns livesync” everytime I make a change in some ts/js file.
@brandon-thimmesch is there any chance that you have
app.gradle
in yourapp/App_Resources/Android
directory and there’s your id in it? I had similar issue when I’ve added my app identifier in the app.gradle and changed it later in my package.json only.Okay - It seems that uninstalling the app from the device, then closing and reopening the command line works as well. Restarting the computer isn’t necessary, but I’m still having the livesync lose the ability to update the application with current code, even after
Ctrl-C
and re-running the command. I’ve runtns doctor
, and everything is installed and running correctly.Thanks again for the help.
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.
@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 😃.
I know im writing into a closed issue, but for everyone experiencing this problem on TNS <= 2.2.0 fix is simple. Edit your installation of nativescript android-livesync-service.js mine was in the
C:\Users\%yourname%\AppData\Roaming\npm\node_modules\nativescript\lib\services\livesync\android-livesync-service.js
Delete lines:
Instead insert:
And livereload works now
I am using Linux (Ubuntu), and not latest node, perhaps this makes a difference. I will try the cache clean. (Attaching he sample with platform/node_modules is not possible on github due to file size restriction.)
After cache clean / npm install I get the same behaviour, this time change in the CSS, which is correctly detected by the tns cli, but the sync is not applied
@jwuliger try to delete the platform folder using the command for example, if you want to delete the Android folder you need to:
then run:
those commands will do the job, after that you can run livesync. The new version of nativescript cli will inform if he didn’t refresh something or not in those cases you need to build first and then run livesync