facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
118.79k stars 24.29k forks source link

Got DOWN touch before receiving UP or CANCEL from last gesture #30080

Closed yevhenlv closed 1 year ago

yevhenlv commented 4 years ago

Got next error in ReactNative (android)

E unknown:ReactNative: Got DOWN touch before receiving UP or CANCEL from last gesture PowerWrap: PowerHal_TouchBoost Screen doesn't react on touch events and looks like freezing, but all background tasks running with success result and debugger doesn't show other errors.

RN 0.63.3 RN-navigation 7.0.0

System: OS: macOS 10.15.6 CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz Memory: 33.66 MB / 8.00 GB Shell: 5.7.1 - /bin/zsh Binaries: Node: 12.18.0 - /usr/local/bin/node Yarn: 1.19.0 - /usr/local/bin/yarn npm: 6.14.4 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman Managers: CocoaPods: 1.10.0. - /usr/local/bin/pod SDKs: iOS SDK: Platforms: iOS 14.0, DriverKit 19.0, macOS 10.15, tvOS 14.0, watchOS 7.0 Android SDK: Not Found IDEs: Android Studio: 3.5 AI-191.8026.42.35.5791312 Xcode: 12.0/12A7209 - /usr/bin/xcodebuild Languages: Java: javac 13 - /usr/bin/javac Python: 2.7.16 - /usr/bin/python npmPackages: @react-native-community/cli: Not Found react: 16.13.1 => 16.13.1 react-native: 0.63.3 => 0.63.3 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

penchef commented 4 years ago

experiencing the same issue ("react-native": "0.63.2", "react-native-navigation": "^6.7.1", // edited) on android emulator in debug mode only.

spacesuitdiver commented 4 years ago

@penchef are you using rn-navigation?

penchef commented 4 years ago

@spacesuitdiver yes "react-native-navigation": "^6.7.1",

UPDATE:

Neither updating to react-native-navigation 6.12.2 nor 7.1.0 solved the issue

yevhenlv commented 4 years ago

RNN version 7.0 I don't know is it correct, but I found solution on rnn docs:

https://wix.github.io/react-native-navigation/docs/installing

app/build.gradle

dependencies { ... implementation 'com.android.support:design:25.4.0' implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}" }

Adding this two dependencies solved problem.

spacesuitdiver commented 4 years ago

Tried what @yevhenlv suggested, no luck on my end, using RNN 7.1.0.

penchef commented 4 years ago

ditto: no luck with suggested workaround, tried RNN 7.0.0 / 7.1.0 / 6.7.1 ...

yevhenlv commented 4 years ago

I think it depends on warnings on screen (after opening one of them I got this error again).

wanschi commented 4 years ago

Same issue here

wanschi commented 4 years ago

@penchef @spacesuitdiver Did you find a solution?

Joshuapwilley commented 3 years ago

Chiming in to say I'm experiencing the same issue.

react-native: 0.63.3 react-native-navigation: 7.1.0

Experiencing the error on real device & emulator. Only occurs in debug mode on Android. Release builds do not have this issue. Also - I am completely unable to use the app at all in debug mode on Android. No touch events register at all.

github-actions[bot] commented 3 years ago
:warning: Missing Reproducible Example
:information_source: It looks like your issue is missing a reproducible example. Please provide a Snack or a repository that demonstrates the issue you are reporting in a minimal, complete, and reproducible manner.
github-actions[bot] commented 3 years ago
:warning: Missing Required Fields
:information_source: It looks like your issue may be missing some necessary information. GitHub provides an example template whenever a new issue is created. Could you go back and make sure to fill out the template? You may edit this issue, or close it and open a new one.
safaiyeh commented 3 years ago

Is this issue specific to RNN? Could someone provide a small repro of this issue, to debug further?

Joshuapwilley commented 3 years ago

I am not sure if this issue is related to RN or RNN, but for anyone who comes across this issue without resolution, I can confirm downgrading to the following versions resolved the issue for me:

react-native: 0.61.5 react-native-navigation: 6.7.5

Obviously this solution will not work for those who want to be on RN 0.63+ and RNN 7+, but I couldn't spend the time troubleshooting this issue so the version downgrade was a welcome compromise.

Frank1234 commented 3 years ago

The LogBox Dialog is picking up (part of) the touches. You can see this when you add a breakpoint to View.dispatchTouchEvent at the places where it returns "true": the ReactRootView from LogBox takes the touch. If you open "LogBoxModule.java" you will see that it creates a ReactRootView, and adds it to a Dialog. This apparently invisible dialog blocks the UI.

The cause: someone is calling "show()" from Javascript, and nothing shows but an empty dialog. I'm done with debugging. Working around the problem for now, by adding my own LogBoxModule implementation, that does not call super.show() and implements canOverrideExistingModule to true. The downside of this is that the app will not show the fullscreen LogBox, only the toasts.

wanschi commented 3 years ago

@Frank1234 Could you share some code or some useful links for creating own module implementations? I'm still facing this issue.

penchef commented 3 years ago

UPDATE

kudos to @risland for isolating the issue!

We've been able to create a (minimal??) reproducible repo:

As @yevhenlv and @Frank1234 were suspecting, the issue seems to be with some empty error dialog popping up over everything else.

In our case the issue was an Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication) caused by the Navigation.registerComponent call inside the persistStore callback.

Moving the Navigation.registerComponent outside solved the issue (for us).

import {persistStore, persistReducer} from 'redux-persist';
import {Navigation} from 'react-native-navigation';
import {combineReducers, createStore, compose} from 'redux';

import AsyncStorage from '@react-native-community/async-storage';

import React from 'react';
import {SafeAreaView, StatusBar, Button, Alert} from 'react-native';

// DOES WORK HERE!
Navigation.registerComponent('foo.bar', () => App);

const store = configureStore();

persistStore(store, null, () => {
  // DOES NOT WORK HERE!
  // Navigation.registerComponent('foo.bar', () => App);

  Navigation.setRoot({
    root: {
      stack: {
        children: [
          {
            component: {
              name: 'foo.bar',
            },
          },
        ],
      },
    },
  });
});

...

Good luck everyone out there!

github-actions[bot] commented 1 year ago

This issue is waiting for author's feedback since 24 days. Please provide the requested feedback or this will be closed in 7 days.

github-actions[bot] commented 1 year ago

This issue was closed because the author hasn't provided the requested feedback after 7 days.