-
-
Notifications
You must be signed in to change notification settings - Fork 197
tns livesync android
not updating application consistently
#1872
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hey @brandon-thimmesch, Can you post more info about {N} CLI version? |
Oh - my bad, forgot to include that. I am working with v 2.0.1 |
Hey @dtopuzov @vchimev @SvetoslavTsenov can you confirm this? |
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 Thanks again for the help. |
Hello I am having the same issue. I am working on an Android app on Windows 10 with v2.0.1 using TypeScript. With the Watch flag enabled, it does close and restart the app on the AVD emulator I am using. The changes I make just do not show up. The process of uninstalling the app from the emulator, closing the cmd and re-running Am I doing anything wrong? Thanks so much for any help! |
Thanks for the report, @brandon-thimmesch and @jwuliger! Could you please elaborate more on:
do you experience this problem?
After what period of time approximately the Currently, we work on the release of NativeScript 2.1.0 and it is expected to be published later this week. Could you please give it a try when it is official as we we have not manage to reproduce such an issue yet? |
@vchimev Absolutely, it seems to occur more often when using an emulator. Here are my details: Devices:
Sync only appears to occur when
The cessation of I will update when {N} 2.1.0 is released, and work with the emulator to see if the issue occurs again |
Hey @brandon-thimmesch, We've just released our 2.1.0 release. Please try it and let us know if you still have problems! |
Sorry I missed the notification on this! 2.1.0 is exciting! I will install now to see if that changes anything. Just a quick note here also. When developing on my Apple, livesync had no issues at all. OK going to try this new version out! |
Hey @enchev I have updated to 2.1.0 and appear to still be having the issue with the application not updating. |
Hello, I have also updated everything but now I am having trouble getting my app to run/build at all. |
@brandon-thimmesch is there any chance that you have |
@jwuliger try to delete the platform folder using the command for example, if you want to delete the Android folder you need to: tns platform remove android then run: tns platform add android
tns build android 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 |
@Alexisvt Hello, thanks for the response! I found that the reason I was not able to build my app was a plugin that needed to be updated. My app now run and builds fine. As far as livesync is concerned, making any changes to an xml file or a css file does not update the changes in the AVD emulator. This is using the command:
However the changes like I said are never made. Please let me know if there is anything I can do or any other information I can provide to help find a solution. It is very difficult to build an app's UI when you are not able to see the changes. Thanks for your help! |
@jwuliger There are indeed some stuff that can't be update it when you use |
I agree with you that there are items that cannot be updated. I am speaking about layout xml and CSS files. Using CLI 2.1 on my iMac the very same files that do not change on my PC/Android do change effortlessly and without problem in any iOS Sim and devices. The same file in the same app on the same CLI version behaves differently. Even with the latest hello world starter. One thing I should try is running the android version on the Mac. I know other people are having this problem as well. I just want to help in any way I can. Thanks! |
Could be related to this? #1810 (comment) I've tried on Windows and Ubuntu and have had the same result. |
Same problem here. just sync .js files. xml and css logs said that was updated but it doesn't. need to close app and open it again. don't need to build again. |
@Bohmaster that issues looks very similar. In my case I am just using Typescript and not NG2. |
Here I have the --log trace output. I think here must be the error This is an excerpt of what I suspect there is something wrong:
|
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. |
I am going to have to take a look at my log and post it here. @Bohmaster you are right man. NatvieScript is amazing and has so much potential. The Livesync issue is the main problem that stands out. I just don't know why it works perfectly on the Mac lol. I am coming from developing apps on Cordova/Ionic. The only good thing about working with the WebView was you could see everything as you were developing in the browser. Much different scenario here of course as we are not dealing with a WebView thanks God!! I think NativeScript would be 100% perfect if the Livesync issue was completed, and just for the sake of faster development maybe a front-end compatible UI framework. When I have the time I might try to put one together. The Telerik UI for {N} are just controls really and that doesn't count! haha. |
@jwuliger Of course! It's a shame... I would love to contribute and develop intensively but this is bringing me down. I've tried both on Ubuntu and Windows systems and have had the same exact problem (EISDIR). I'm using this repo as a seed: https://github.com/NathanWalker/angular2-seed-advanced. It's great and includes some cool libraries (ng/rx) and features. @jwuliger Do you have the same output error (EISDIR)? |
I have the same problem with the basic scaffold application (TAP button demo with JavaScript, not Angular 2). I am using nativescript 2.1.1, android sdk 25.1.7, platform sdk 23, build tools 23.0.3 android api 23 (Android 6) with Intel x86 Atom_64 System Image as emulator. Output shows no problem
I noticed that when I restart the app in the emulator manually (without uninstall/reinstall) the changes are visible as well. So it may be just a missing restart? (But since it works on the first change, perhaps it would be possible to have that always without a restart, that would be nice ;) ) |
Hey @everflux @Bohmaster @jwuliger @pess0a, As far as I understand the issue is only related to XML files. Is that true? Can you try to change something in the CSS to see if subsequent changes will work? Do you change something in the main screen of the app or you have navigation and you are changing some of the inner pages? |
I had the same issue with CSS changes, even when the app is relaunched by the nts cli. |
Hey @everflux, Can you post the exact steps (from project creation) and/or send us your project to try it locally? |
Awesome, thank you for your efforts. I am currently using this command to install the SDK, should I use the latest/different version of build tools instead?
|
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
Delete lines: AndroidLiveSyncService.prototype.sendPageReloadMessage = function () {
var future = new Future();
var socket = new net.Socket();
socket.connect(AndroidLiveSyncService.BACKEND_PORT, '127.0.0.1', function () {
try {
socket.write(new Buffer([0, 0, 0, 1, 1]));
future.return();
}
catch (e) {
future.throw(e);
}
finally {
socket.destroy();
}
});
return future;
}; Instead insert: AndroidLiveSyncService.prototype.sendPageReloadMessage = function () {
var future = new Future();
var socket = new net.Socket();
socket.connect(AndroidLiveSyncService.BACKEND_PORT, '127.0.0.1', function () {
socket.write(new Buffer([0, 0, 0, 1, 1]));
});
socket.on("data", function(data) {
socket.destroy();
future.return();
});
return future;
}; And livereload works now |
@archonik This works now but not for css files. Can you check that? Both xml and .ts/js files reflects as spected. To see css files reflected I need to kill the process and run it manually again for every change. |
@archonik Awesome stuff! I can confirm with @Bohmaster CSS files still do not work. I get this in the console: It is also very very slow. Better than not working though!! Nice work! |
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. |
@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 |
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. |
@archonik Thank you very much, that seems to have solved the sync issue for me. |
@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 :). |
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 |
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. |
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'. |
@iamnotagit |
Thanks for the explanation @m-abs! I have managed to get this working!! |
@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. |
@iamnotagit Not a problem. I also have many inconsistencies. I am looking forward to version 2.2!! It looks like it is coming soon :) |
This seems to work fine We need to provide device ID/Index |
I had the same problem, unfortunately with Nativescript version 2.3.0... I uninstalled the app on the emulator and it works fine again, changes made in the HTML files are being updated again. |
I'm using the Android emulator livesync with Is there a way (in a hook file or elsewhere) to force CSS and HTML to do the same restart as TypeScript files? |
@zakdances we are very interested to know the specifics of this. Which plugins break when CSS/HTML is changed? |
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 runtns livesync android --emulator --watch
and had the application refresh with the newly updated code as expected; however, it will randomly stop updating. I willCtrl-C
then re-runtns 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.
The text was updated successfully, but these errors were encountered: