nativescript-dev-webpack icon indicating copy to clipboard operation
nativescript-dev-webpack copied to clipboard

HMR : app not reloading after app switching or screen off (android)

Open jbarnabe opened this issue 5 years ago • 7 comments

Environment

√ Component nativescript has 6.0.0 version and is up to date. √ Component tns-core-modules has 6.0.1 version and is up to date. √ Component tns-android has 6.0.0 version and is up to date. √ Component tns-ios has 6.0.1 version and is up to date. "nativescript-dev-webpack": "1.0.1"

Describe the bug

Testing on an Android device (9.0 Pie) and Android Emulator (API 25) : HMR is working well, but if you switch to another application or to the home screen and come back to the nativescript application HMR seems working on CLI but application is not refreshing on device. same behavior when the screen goes to sleep, after unlocking HMR seems working on CLI but application is not refreshing.

To Reproduce

Just create a new fresh projet tns create hmr-test --ng and tns run android and try to modify some code after application switch or screen lock / unlock.

jbarnabe avatar Jul 17 '19 22:07 jbarnabe

Hey @jbarnabe , Thanks for your report. Does the HMR apply after unlocking the device and making a new change in your code?

rosen-vladimirov avatar Jul 22 '19 07:07 rosen-vladimirov

Hi, @rosen-vladimirov Thanks for your reply.

No, unfortunaly no change after unlock, in the console everything seems to be OK : after each save on editor all things seems to be generated and synchronized to the device (according to the console messages). But nothing happens on the device. Everything works normally as long as the screen is not locked or I don't switch the application.

I don't know if I'm clear ? I have the problem with a blank Angular project, are you able to reproduce it ?

jbarnabe avatar Jul 23 '19 09:07 jbarnabe

I am able to reproduce this in an emulator:

  1. tns debug android
  2. Click home button
  3. Click square button and bring back the application from the background
  4. Try editing the code

HMR kicks in but the device is not refreshed.

nikoTM avatar Jul 23 '19 11:07 nikoTM

Is there a fix in sight or a workaround available? This bug unfortunately makes developing with Nativescript really unpleasant.

MrSnoozles avatar Sep 03 '19 10:09 MrSnoozles

did anyone solve this somehow? I have the exact same problem. strange thing is - on one page of the app it does it - on the other not...

Additional Info: I just have some buttons that you can click and should change colors in certain ways. after locking the tap events still fire in the console- but fire multiple times in random numbers it seems but noting happens on the screen.

now notably if i lock and unlock again everything goes back to normal!

I also hooked all possible android events to the page and on the first unlock the resume event fires many times but also random numbers it seems

roxart avatar May 14 '20 07:05 roxart

I'm having the exact same issue has this been resolved?

hraynaud avatar Aug 17 '20 11:08 hraynaud

Has this been fixed yet?

Sunhat avatar Dec 04 '20 11:12 Sunhat