Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Keeps uploading with old files on Android #256

Closed
keerl opened this issue Aug 29, 2018 · 8 comments
Closed

Keeps uploading with old files on Android #256

keerl opened this issue Aug 29, 2018 · 8 comments
Assignees

Comments

@keerl
Copy link

keerl commented Aug 29, 2018

Please, provide the details below:

Did you verify whether this issue has already been reported here?

Yes

Tell us about the problem

Everything will be working nominally for hours then randomly it will start only uploading the last file that was saved and all the other files will revert to a previous version. So for example, if I'm working on 2 files, and I make a change to the first then save it and it will upload. But if I make a change to the second file and save and upload it, the first file will revert to the version before that. Hopefully that makes sense. It is extremely frustrating. I have tried clearing the cache folder on my phone, complete uninstall/reinstall and nothing can really fix it consistently.

Which platform(s) does the issue occur on?

Android
Windows

Provide the following version numbers that the issue occurs with:

  • NativeScript Sidekick Desktop or Sidekick for Visual Studio: 1.12.0-v.2018.8.14.2
  • NativeScript CLI: 4.2.2
  • CLI extension nativescript-cloud: 1.13.0
  • CLI extension nativescript-starter-kits: 0.3.4

Tell us how to recreate the issue in as much detail as possible

I do not what triggers it to happen, as far as I can tell it is random. Or I do not what know what triggers it.

Does this issue happen every time?

No

@ggarabedian ggarabedian self-assigned this Aug 31, 2018
@ggarabedian
Copy link
Contributor

Hello @keerl,

This sounds like a very strange and frustrating behavior, one which we haven't observed and unfortunately cannot reproduce when testing locally with a sample app.

With the above in mind, to investigate this further, I would ask you to share the logs that contain more information about this issue. If you are not sure which logs can be helpful, you can continue working on your app and once you experience the problem again, close Sidekick, access the folder that contain the logs and share the latest log files.

@keerl
Copy link
Author

keerl commented Sep 4, 2018

I was able to recreate this issue almost instantly with the simple tab template. I'll attach a video showing the issue I am having and I'll also attach the log files.

In the video I start out showing the stock tab template, then I change the first file and change the tab names, it uploads and works fine. Then I go into another file, css in this example, and I just comment everything out to make an obvious change. Then that uploads and works but this time you will see the tabs went back to their original names. So then I go back to the first file and change a name again. It'll upload and work, but the css will go back to the original version.

As you can see in this example it is extremely frustrating and makes developing nearly impossible. The only way I can fix it is by rebuilding the entire project, which takes like 10 minutes and wastes my build credits.

https://www.youtube.com/watch?v=owrNzpI3aaM

main_18-09-04_08-47-34.107.log
prerequisites_18-09-04_08-47-46.908.log
console_18-09-04_08-47-31.089.log

@ggarabedian
Copy link
Contributor

@keerl, thank you for sharing the logs and especially for taking the time to capture a video of the faulty behavior.

We are suspecting that adb is throwing an error while we try to save some information about the build (nsbuildinfo) and the NativeScript CLI decides to install the app again. However, it is taking some kind of intermediary (old) version of the app. We have seen similar behavior in the past and the reason back then was related to reaching the size limit of the (...)/data/local/tmp folder.

Having said that, can you please open a Command Prompt and run the commands provided below. They will delete the content of the (...)/data/local/tmp folder and this should resolve the reported problem.

%ANDROID_HOME%\platform-tools\adb shell
cd /data/local/tmp
rm -rf *
rm -rf .*

Let me know if this helps.

@keerl
Copy link
Author

keerl commented Sep 7, 2018

This solution does not work for me. I can completely empty the tmp folder and nothing will change. I do have a suspicion though, my phone is a Pixel and recently got updated to Android 9 (which I believe are the only phones that have 9), so I plugged in another phone with Android 8 side-by-side with mine and the Android 8 ones works fine and my Android 9 does not.

So either there are some new changes introduced in Android 9 that cause some bugs with NativeScript, or there is something wrong with my phone.

Let me know your thoughts.

@ggarabedian
Copy link
Contributor

ggarabedian commented Sep 10, 2018

We haven't had much dealings with Android 9 so far (with it being 1 month old and available mostly on Pixel devices), but we have access to a Pixel device with this version and we were able to do some tests. However, everything appeared to be working correctly and we were not able to reproduce anything similar to the reported behavior.

Having said that, can you please enable the verbose logging for Sidekick and send us the produced logs? Here are the steps to enable the Sidekick verbose logging:

  1. Ensure that Sidekick is not running (in the task manager as well) and delete the old files in %appdata%\NativeScriptSidekick\Logs.
  2. Navigate to %appdata%/npm/node_modules/nativescript/config and open the config.json file that is in this folder.
  3. Change "DEBUG": false to "DEBUG": true.
  4. Start Sidekick, reproduce the problem and then completely stop Sidekick (from the task manager).
  5. Send us the newly created log files.
  6. Don't forget to set the DEBUG option to false, because otherwise you will notice significant drop in the performance of Sidekick due to the large amount of logging done.

@keerl
Copy link
Author

keerl commented Sep 10, 2018

Logs.zip

Here are the log files. One thing I did notice (because debug mode slowed everything down) is that it tries to upload the app like 4 times to my phone. I can see the splash screen open, then it closes and another one opens, and repeats a couple times.

@KristianDD
Copy link

Hi @keerl
I am sorry for the late response, but it took some time to investigate and fix the issue. Today we released a new version of the Nativescipt CLI (v4.2.4), which should resolve the strange behavior you reported with the Android P device. Please give it a try when you can and don't hesitate to write back if the issue persists.

Thank you for the detailed description and the provided information. It helped a lot with investigating and fixing the issue.

@keerl
Copy link
Author

keerl commented Sep 25, 2018

Sorry for the delay, it looks like it is behaving correctly now! Thanks for your help.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants