-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
Remote Debugger breaks onPress on Touchable Components #27008
Comments
I have same problem too |
I am seeing this on actual devices, Samsung S8 and intermittently on Pixel 2. If I tap many times very fast I can sometimes trigger the event on the Pixel 2, but it never fires on the S8. edit: Both are running Android 9. |
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions. |
I don't seem to have permissions to add a label, but this is definitely still an active issue and should not be closed. |
same problem,onpress event not work,on android6 |
I believe I ended up tracking this down to an issue with there being a time difference between the host and device. Since the time is off, the calculation for whether it was a short press or long press is broken (or something like that). You can verify this by running |
Nice research @alexciarlillo. That definitely sounds plausible. Ideally this time sync would be something RN handles itself upon init. I know if you spend too long at a breakpoint when using |
To sync up time on Linux and OSX: This command requires a rooted phone. Can confirm that the press is now working. |
@alexciarlillo Do you know why this occurs? Why are press events being processed on the package server and not the consumer? I just ran into this again and this is really annoying and takes a while until you realize that this is the issue (maybe anyone knows whom to bother with this? :D). |
I'm not sure what the root cause is here, but when using remote debugging the code will always execute on the host machine, not the device itself. It's probably just mixup between the timestamp sent along with the native event not matching the actual time of the package server when it handles the event. |
This is not just breaking |
I have weird issues with The interval in code is usually not the interval that is followed. What usually happens in a transition that is meant to take say 2000ms, completes in 200ms. I usually just force stop the application (Android) and then restart it. I wonder if this issue is related to the one being discussed here. |
@juanjsebgarcia If you're experiencing this run |
Thing is still not working for me, i ahve Huawei P20 i tried to disable/enebale automatic time in settings but problem is still there, my phone and mac have 2 sec diff. |
@alexciarlillo You could have saved a lot more lives by recalling the |
@abhisheq6u ... |
It solves, thx... but what a craziness! |
a few of us are experiencing this after an upgrade from 0.61 to 0.62. It would be great to have this addressed; it's quite a major step backward not to be able to use the "improved" debugging mode on a physical device. Unfortunately not all of our development devices are/can be rooted. |
I have 1 second difference that I can't fix. And app doesn't trigger onPress. Nice to see that this issue isn't fixed from Oct 25. |
Same issue |
Also had a 2 sec difference. Disabling and enabling |
In my case, none of this worked and I don't have a rooted device, so I ended up matching the time of phone and system manually. Apparently, accuracy upto milliseconds is not required, accuracy upto seconds is enough. So it worked that way. I have to do it everytime though and its really annoying. |
Make sure you set the real device or emulator time as the same as your pc or laptop time until the seconds part should be the exactly the same. I have tried it and it solved |
i'd agree (without much context for what the alternatives are, if any) that relying on timestamps being similar between two different computers for any functionality is a dangerous proposition. |
@petergaultney @WouterFlorijn Agreed, relying on exact time sync between two systems seems like a pretty universally "bad idea". @safaiyeh Do you know why this time sync is a requirement or know who to tag to get that answer? I think that's probably the first step in figuring out the best solution for the issue. |
Still not fixed yet ? |
i have the same issue when i use firefox as debugger. Try use chrome as debugger, and when running your project try "npm start" then "npm run android/ios" . It solve my problem. Hope it solve yours too. Have a nice day everyone. |
Re-enabling and enabling the automatic time option works (NOTE: Internet must be turned on for sure else it won't work !) |
@varunraghu3112 I tried this and it worked sometimes (not always) do we also have to remove the cable from the device, so that we start |
@alexciarlillo That was exactly my case! Would never thought about that thanks :) |
Turning on/off Time date works only sometimes, and I don't have rooted device, please react-native team look into this Seriously, the development experience in React-Native is worst. |
I have a Samsung Galaxy A50 phone. In some rare times, toggling the automatic update on and off is the trick that I need to sync the time but most of the time, it is not forcing the phone to sync the time with the NTP server. |
Hey @HosseinRashno no need for that language. This is open source software. If it really bothers you so much, why don't you fix it? We open issues to help resolve them, its a collective effort to fix it. |
@juanjsebgarcia You're right. I've edited my comment and removed that part. I was just tired of spending a day fixing something that looks so simple! |
This way also works for emulator devices! |
Same issue here, even on iOS (real device in debugging mode). So can't use |
The only way to resolve this is to set your phone's time exactly equal to your laptop's timestamp, the time should be equal to seconds (milliseconds not counted). |
Have this issue as well with the remote debugger turned on, on both my physical Android and Iphone device. Attempting to sync the time on my devices & computer slightly alleviates the problem, but does not fix it. |
Still happening in my Android device. A real headache this problem is! |
I believe that "timers" ( I use |
I used onPressIn() instead of onPress for now :/ |
meet same problem ,drive me crazy.. my solution: |
I'm also experiencing this issue, but on iPhone 11 Pro, so running Makes debugging a real device near impossible. Does anyone have any solutions that aren't android focussed? |
For android, i didn't had a rooted phone. So instead i synced my host clock with phones clock. It retrieves seconds and milliseconds since epoch, and sets it on the host. sudo date +"%s.%N" -s @$(adb shell date +%s.%N) Then you can check the time difference between host and phone using as @evelant showed echo "Host\t\t$(date +%Y-%m-%d_%H:%M:%S:%3N)" && echo "Emulator\t$(adb shell date +%Y-%m-%d_%H:%M:%S:%3N)" |
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
This issue was closed because it has been stalled for 7 days with no activity. |
React Native version: 0.61.2
Steps To Reproduce
onPress
andonLongPress
parametersonLongPress
is fired and notonPress
even on short tapsDescribe what you expected to happen:
Upon a quick tap the component
onLongPress
fires, expectedonPress
to fire.Minimal example
When in remote debugging onLongPress always fires.
The text was updated successfully, but these errors were encountered: