Skip to content

Debug on Android fails when stopped on breakpoint and change in .xml/.css/.html is applied #4227

@rosen-vladimirov

Description

@rosen-vladimirov

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
  • Cross-platform modules: 5.1.0
  • Android Runtime: 5.1.0
  • iOS Runtime: Not applicable
  • Plugin(s): Not applicable

Describe the bug
When debugging on Android, if you've stopped on a breakpoint and apply a change in .xml/.css/.html file, the change will be synced, but CLI will stuck on Sync operation in progress... for a while and after that an error will be shown: Unable to apply changes for device: <device id>. Error is: Sync operation is taking too long.

To Reproduce

  1. tns create myApp --js
  2. cd myApp
  3. tns debug android
  4. When CLI prints a Chrome URL, open it in the browser.
  5. Place a breakpoint on line 17 of main-view-model.js (inside the onTap method: this.counter--;)
  6. Tap the button on the Android device - Chrome DevTools should stop on the breakpoint.
  7. While you've stopped on the breakpoint, open your project in VSCode.
  8. Open main-page.xml in VSCode and change the title of the ActionBar from:
        <ActionBar title="My App" icon="" class="action-bar">

to

        <ActionBar title="My App 2" icon="" class="action-bar">
  1. Save the file
  2. Now check your terminal. CLI will print the following messages:
Executing before-shouldPrepare hook from <path to hook>
Preparing project...
Executing before-prepareJSApp hook from <path to hook>
Project successfully prepared (Android)
Executing after-prepare hook from <path to hook>
Successfully transferred main-page.xml on device <device id>.
Sync operation in progress...
Sync operation in progress...
Sync operation in progress...
Sync operation in progress...
Sync operation in progress...
Unable to apply changes for device: <device id>. Error is: Sync operation is taking too long.
Executing after-watch hook from <path to hook>
Stopping webpack watch

Expected behavior
CLI should sync the change and allow you to continue debugging.

Additional context
Issue is not reproducible in case you've not stopped on breakpoint.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions