Skip to content
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

TNS syncAllFiles on Android frequently crashes with error #4264

Closed
NathanaelA opened this issue Jan 5, 2019 · 14 comments
Closed

TNS syncAllFiles on Android frequently crashes with error #4264

NathanaelA opened this issue Jan 5, 2019 · 14 comments

Comments

@NathanaelA
Copy link
Contributor

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 5.1.0 (Also saw this issue in 5.0)
  • Cross-platform modules: 5.1.1
  • Android Runtime: 5.1.0
  • Plugin(s): Developing plugin 😀
  • OS: Linux

Describe the bug
I use tns run android --syncAllFiles while developing my plugin; but the issue is about every 4 to 10 updates; the CLI comes back with the error:
Unable to apply changes for device:<DEVICE_ID>. Error is: The parser encountered an unexpected exception.. Sometimes it does not report any error but just stops without any messages.

To Reproduce
Make changes to a plugin in the node_modules folder and let tns resync the app.

Expected behavior
It to continue working. 😀

Additional context
When it dies; I can't hit CTRL-C to abort it; have to find the tns process and kill it... (Which is also very annoying).

@DimitarTachev
Copy link
Contributor

Hi @NathanaelA,

I tried to reproduce the issue using the image picker plugin but everything is working as expected. I've changed a few js plugin files, using a linked plugin and the typescript demo. Also, we've never seen such error in our plugins. Could you please specify the following details:

  1. What kind of demo application do you use - js, ts, ng, vue?
  2. Is your plugin linked in node_modules or installed from a local .tgz?
  3. What kind of files do you change in order to trigger the LiveSyncs (ts, js, xml, css)?

Also, a sample application reproducing the problematic behavior will be appreciated.

@NathanaelA

This comment was marked as abuse.

@DimitarTachev
Copy link
Contributor

DimitarTachev commented Jan 28, 2019

Hi @NathanaelA,

We tried the same steps both on Ubuntu and MacOS:

  1. Clone the Image Picker plugin.
  2. Execute npm i in its src folder.
  3. Execute tns run android --syncAllFiles in its demo folder.
  4. Apply some change in the plugins ts/js file (e.g. in https://github.com/NativeScript/nativescript-imagepicker/blob/master/src/imagepicker.android.ts)
  5. Repeat (4) 30+ times.

but everything is working as expected on our side.

As far as I see this error can be thrown during .apk installation, which is not an expected operation during LiveSync of JS files. We've seen such behavior when the Android Emulator's folders limit is reached and we are not able to execute the LiveSync operation.

Could you please provide the trace logs from a problematic LiveSync of your demo app (tns run android --syncAllFiles --log trace) in order to allow us investigate this issue further? Also, I suggest you try the above-mentioned steps with the Image Picker repository in order to check if this is something related to a specific code in your plugin.

@NathanaelA

This comment was marked as abuse.

@NathanaelA

This comment was marked as abuse.

@DimitarTachev
Copy link
Contributor

Unfortunately, these are the regular logs from our CTRL + C handling. If the CLI process does not exit after these logs, this means that there is a leaked child process or a socket.

In order to investigate both the CTRL + C handling and the Unable to apply changes for device:<DEVICE_ID>. Error is: The parser encountered an unexpected exception.., we need your trace logs from the whole LiveSync process.

Also, do you get these error on the same device/emulator or they are not depending on a specific device?

@NathanaelA

This comment was marked as abuse.

@DimitarTachev
Copy link
Contributor

@NathanaelA

Maybe the easiest approach is to use tns run android --syncAllFiles --log trace | tee log.txt and attach (drag & drop) the generated log.txt in a comment here.

@NathanaelA

This comment was marked as abuse.

@DimitarTachev
Copy link
Contributor

Thanks for the logs and the additional details.

Unfortunately, we were not able to find the reason for the missing assets/app folder from the logs. The folder is not deleted from a hook as the webpack hooks are skipped internally when you run without --bundle and it seems that you don't have any additional hooks.

We also tried to reproduce this behavior with the free version of the SQLite plugin and exactly the same CLI and webpack versions but everything is working as expected when we run tns run android --syncAllFiles and make changes in node_modules/nativescript-sqlite/sqlite.android.js.

Could you try the following actions:

  1. Ensure there aren't any leaked CLI or Webpack process before you run tns run android --syncAllFiles - the issue could be caused by a leaked CLI process which is deleting the above-mentioned folder (if you don't have any important node processes, the easiest solution is killall -9 node).
  2. Try to reproduce the issue in the demo of the free version of your SQLite plugin (reviewing your logs, we found out that you are making changes in node_modules/nativescript-sqlite-sync/sync.js which is not available for testing).

@NathanaelA

This comment was marked as abuse.

@DimitarTachev DimitarTachev removed their assignment Apr 1, 2019
@DimitarTachev DimitarTachev added this to the 6.0.0 milestone Apr 8, 2019
@rosen-vladimirov rosen-vladimirov added this to Inbox in CLI Team May 15, 2019
@rosen-vladimirov
Copy link
Contributor

rosen-vladimirov commented Jul 16, 2019

Hey @NathanaelA ,
As in NativeScript 6.0 we are going to support only bundle workflow and syncAllFiles option is not supported anymore, this issue should not be reproduced anymore. Can we consider it as resolved?

@NathanaelA

This comment was marked as abuse.

CLI Team automation moved this from Inbox to Done Jul 16, 2019
@rynop
Copy link
Contributor

rynop commented Aug 28, 2019

With 6.0, how do I pick up a change I made manually in a node_modules dir? Blow away platforms dir and re-run tns run ..?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
CLI Team
  
Done
Development

No branches or pull requests

5 participants