Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

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

Open
jbarnabe opened this issue Jul 17, 2019 · 7 comments
Open

Comments

@jbarnabe
Copy link

jbarnabe commented Jul 17, 2019

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.

@rosen-vladimirov
Copy link
Contributor

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

@jbarnabe
Copy link
Author

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 ?

@nikoTM
Copy link

nikoTM commented Jul 23, 2019

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.

@vchimev vchimev self-assigned this Jul 24, 2019
@MrSnoozles
Copy link

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

@roxart
Copy link

roxart commented May 14, 2020

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

@hraynaud
Copy link

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

@Sunhat
Copy link

Sunhat commented Dec 4, 2020

Has this been fixed yet?

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

No branches or pull requests

8 participants