Tns run android building old code



Have a question with an issue I’m currently having with Nativescript+TS (no Angular).

I thought it was an issue with my ongoing project, but choose to start a blank template and the issue appeared there as well.
What’s happening is that when I run tns run android it compiles and runs, but when I modify files, sometimes old code it’s being used instead of the modifications I did.
Even the code in platforms/android/app/src/main/assets changes, but not on the phone (nor the emulator).

I used adb as root to check the files being uploaded and indeed they were old code, not the actual state of my src folder.

I didn’t want to start an issue on GitHub in fear it could be anything else not related to NS, but it’s extremely weird.

What I’ve done so far:

  • Reinstalled nativescript
  • Reinstalled Node (v8.11.1 and v9.11.1, same issues)
  • Create a clean project, issue persists

My phone runs Android Oreo (8.0) and I’ve tested both Android Nougat and Oreo in the emulators.

Does anyone have an idea? I’m running out of options


That’s a very strange error indeed. Try deleting the platforms/android folder of your project, deleting the app from your device and starting fresh. If you can reproduce the error, please post an issue on GitHub.