Skip to content
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

React native required dispatch_sync to load #722

Closed
LukePenkava opened this issue Aug 7, 2019 · 48 comments
Closed

React native required dispatch_sync to load #722

LukePenkava opened this issue Aug 7, 2019 · 48 comments
Assignees
Labels
BugBash 31.03 Platform: iOS This issue is specific to iOS

Comments

@LukePenkava
Copy link

Hi, i am getting this error once in a while when reloading React Native app. No idea, if that is something on my side or what to do with it. But i think that this error has something to do with navigator.geolocation.getCurrentPosition(). Not sure tho. Thanks for any help.

react native required dispatch_sync to load constants for RNGestureHandlerModule. this may lead to deadlocks

@SnehalAgrawal
Copy link

Is it an error or showing as a warning?

@sowee15
Copy link

sowee15 commented Oct 1, 2019

I started getting this as well. It's a warning (yellowbox). Any idea what it means?

@msageryd
Copy link

msageryd commented Oct 29, 2019

I have seen it occasionally before. But after upgrading from 1.3.0 to 1.4.1 I get it on every app-start in the simulator.
@SnehalAgrawal It's a warning.

edit: I'll take it back. It's not every start, but most.

@jerryheir
Copy link

Any fix?

@jakub-gonet jakub-gonet added the Platform: iOS This issue is specific to iOS label Sep 3, 2020
@jakub-gonet jakub-gonet self-assigned this Jan 5, 2021
@newfylox
Copy link

2021 and still have this warning on iOS. I am using react-native: 0.60.6 and react-native-gesture-handler: 1.10.3

@hirbod
Copy link

hirbod commented Dec 13, 2021

This error showed up for me the very first time after upgrading expo sdk to verison 44. (RNGH v2)

@rafaelmaeuer
Copy link

Same error for me, seemed to appear after upgrading to RNGH v2

@hirbod
Copy link

hirbod commented Dec 16, 2021

I've upgraded to RNGH 2.1.0 - but the error still remained. I've checked the docs once again, and found that we should wrap our app with a GestureHandlerRootView since 2.0.0.

So what I changed

import 'react-native-gesture-handler';
import { GestureHandlerRootView } from 'react-native-gesture-handler';
....

  return (
    <DripsyProvider theme={colorMode === 'dark' ? theme : themeLight}>
      <QueryClientProvider client={RNQueryClient}>
        <SafeAreaProvider initialMetrics={initialWindowMetrics}>
          <GestureHandlerRootView style={{ flex: 1 }}>
            <Navigator theme={combinedTheme} />
          </GestureHandlerRootView>
        </SafeAreaProvider>
      </QueryClientProvider>
    </DripsyProvider>
  );

After wrapping with GestureHandlerRootView, the warning disappeared for me and never returned, even after 40 App restarts.
The only thing I am unsure about is the fact that I have to import rngh and import GestureHandlerRootView. Do I still need to import it that way?

@cristianoccazinsp
Copy link

I'm wrapping the view, yet I keep getting the same warning. Thoughts?

@hirbod
Copy link

hirbod commented Dec 17, 2021

I did not dig into it. At least the warning did disappear for me after wrapping it with the RNGHRootView.

At the end, it’s just a warning and we could add an exception to yellow box to get rid of it.

Edit: after couple of restarts, it did appear again for me as well. So my provided "solution" isn't one.

@Dramex
Copy link

Dramex commented Dec 19, 2021

same issue here.

@comur
Copy link

comur commented Dec 19, 2021

same here

@3runoDesign
Copy link

same here!

@danielgospodinow
Copy link

Same here.

@KhachDavid
Copy link

Same issue here. Wrapping with the RNGHRootView didn't work for me as well

@lockieluke
Copy link

i can't believe this issue has been around for two years

@KhachDavid
Copy link

i can't believe this issue has been around for two years

Ikr...Is it dangerous to just suppress it and hope for the best?

@gdoudeng
Copy link

gdoudeng commented Jan 5, 2022

+1

@VladislavDDP
Copy link

same issue, suppose it happens cause of lib version

@michaelypes
Copy link

michaelypes commented Jan 10, 2022

Just done a complete new build and getting this error just showing a simple homescreen in react-navigation. Followed suggested solution and not worked.

"@react-navigation/native": "^6.0.6",
"@react-navigation/native-stack": "^6.2.5",
"react": "17.0.2",
"react-native": "0.66.4",
"react-native-gesture-handler": "^2.1.0",

After a bit more research it seems adding the stack is causing the problem

@react-navigation/native-stack

Very basic app setup, with no stack in the navigator it does not cause the error

import 'react-native-gesture-handler';
import * as React from 'react';
import { View, Text } from 'react-native';
import { GestureHandlerRootView } from 'react-native-gesture-handler';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';

function HomeScreen() {
  return (
    <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
      <Text>Basic Home Screen</Text>
    </View>
  );
}

const Stack = createNativeStackNavigator();

function App() {
  return (
    <GestureHandlerRootView style={{ flex: 1 }}>
      <NavigationContainer>
        <Stack.Navigator>
          <Stack.Screen name="Home" component={HomeScreen} />
        </Stack.Navigator>
      </NavigationContainer>
    </GestureHandlerRootView>
  );
}

export default App;

@3runoDesign
Copy link

I didn't get the error anymore...
follow my configuration:

"@react-navigation/elements": "^1.2.1",
"@react-navigation/native": "^6.0.6",
"@react-navigation/stack": "^6.0.11",
"react-native-gesture-handler": "^2.1.0",
"react-native-reanimated": "^2.3.1",
"react-native-safe-area-context": "^3.3.2",

@farcondee
Copy link

farcondee commented Jan 17, 2022

Finally I got it to work.

My app previously crashed on Android and produced the warning message in ios. Now the app starts and works flawlessly on both platforms. I finally got it to work by downgrading react-native-reanimated.

In package.json, I changed
"react-native-reanimated": "~2.3.1"
to
"react-native-reanimated": "~2.2.4"

Then I ran a yarn install and a pod install in the ios folder

@mattahorton
Copy link

Didn't work for me. I am currently ignoring this but would love to know if it's a bug.

@nzcodarnoc
Copy link

Thank you so much @farcondee !

Confirming that #722 (comment) fixed the problem for me.

@filiphorvei
Copy link

Didn't work for me. I am currently ignoring this but would love to know if it's a bug.

It didn't work for me either, but then I looked at react-native-renanimated in node_modules and realized it wasn't actually downgraded by npm when I changed package.json and ran "npm install". I had to run "npm install [email protected]" for it to work :)

@dthomason
Copy link

downgrading react-native-reanimated to 2.2.4 worked for me. Ran into the same issue as @filiphorvei and had to rm -rf node_modules to get it to actually downgrade. I've had more issues with that library than any other I think.

@jetaggart
Copy link

@farcondee this worked for me as well, thank you! Spent hours hunting around in the dark after updating libraries.

@mackenziekira
Copy link

After downgrading to [email protected], does anyone else see this warning instead?

'SplashScreen.show' has already been called for given view controller.
at node_modules/react-native/Libraries/Utilities/RCTLog.js:34:8 in logIfNoNativeHook

@marcusnunes
Copy link

Finally I got it to work.

My app previously crashed on Android and produced the warning message in ios. Now the app starts and works flawlessly on both platforms. I finally got it to work by downgrading react-native-reanimated.

In package.json, I changed "react-native-reanimated": "~2.3.1" to "react-native-reanimated": "~2.2.4"

Then I ran a yarn install and a pod install in the ios folder

This worked here.

@LunatiqueCoder
Copy link

LunatiqueCoder commented Feb 24, 2022

Finally I got it to work.

My app previously crashed on Android and produced the warning message in ios. Now the app starts and works flawlessly on both platforms. I finally got it to work by downgrading react-native-reanimated.

In package.json, I changed "react-native-reanimated": "~2.3.1" to "react-native-reanimated": "~2.2.4"

Then I ran a yarn install and a pod install in the ios folder

Indeed this solution also worked for me. As a side note, on the project we're working on, I'm the only one with an M1 Apple Silicon and had this issue. My other colleagues with an Intel did not have this problem. I had to beg my team to downgrade so I could work normally with them.

@sarliram
Copy link

it doesn't work for me

@zoobibackups
Copy link

Any solution? or just downgrade to v1

@billnbell
Copy link

billnbell commented Mar 21, 2022

https://stackoverflow.com/questions/70915817/getting-error-rctbridge-required-dispatch-sync-to-load-rngesturehandlermodule-t/71551858#71551858

Also, why does 2.2.4 work but later ones don't work - but give this error. Who can look at this?

@samshahbazi
Copy link

In package.json, I changed

"react-native-reanimated": "~2.5.0"
to
"react-native-reanimated": "2.4"

Then I ran a yarn install and a pod install in the ios folder

@billnbell
Copy link

And you probably got the error.

@pke
Copy link

pke commented Mar 30, 2022

I just upgraded react-native-reanimated to 2.5.0 cause we got Android ANRs with older versions constantly.
I am also getting the RNGH dispatch_sync warning (using react-navigation of course).
The log entry clearly specifies RNGH as the culprit though, so the question is what might cause dispatch_sync being called during initialisation (that is iOS btw).

@billnbell
Copy link

It appears this package is being maintained, but no one ever responds to this issue. We need to upgrade and get rid of this message. How do we do that if none of us knows what the actual issue is?

@pke
Copy link

pke commented Mar 30, 2022

And it actually does make the app unresponsive occationally (as it says in the warning), especially on Android. We see that in ANR reports that reanimated hangs in a lock (probably created by RNGH?).

@jakub-gonet is assigned to this issue GH writes and he works at software mansion so maybe he can shed some insights on this issue?

@j-piasecki
Copy link
Member

Hi! It may be caused by the integration between the Gesture Handler and Reanimated to allow for synchronous manipulation of gesture state. We will look into this, but I can't give an ETA unfortunately.

@fukemy
Copy link

fukemy commented Apr 19, 2022

any solution now?

@j-piasecki
Copy link
Member

It's possible that software-mansion/react-native-reanimated#3166 fixes the problem. You could use patch-package to check if it solves the issue for you.

@duro
Copy link

duro commented Apr 25, 2022

@j-piasecki I tired out the version of reanimated that has that fix included, but I still get the warning

@j-piasecki
Copy link
Member

In that case, could you prepare an example app to reproduce it? I've tried a new RN 0.67 app with Gesture Handler 2.4.1 and Reanimated 2.8.0 and I didn't get the warning.

@pqkluan
Copy link

pqkluan commented Apr 27, 2022

For anyone who tried the new version but still get the warning, please rebuild your app for native code to take effect.

@elrony
Copy link

elrony commented Oct 14, 2022

Looks like this is happening again after I upgraded from react-native-reanimated 2.10.0 to 2.11.0

@matallui
Copy link

Same here, after upgrading from 2.9.1 to 2.11.0

@j0eii
Copy link

j0eii commented Oct 26, 2022

Same here, after upgrading from 2.9.1 to 2.11.0

same, i fallbackto2.8.0

@j-piasecki
Copy link
Member

Fixed in software-mansion/react-native-reanimated#3698. Please upgrade react-native-reanimated to 2.12.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BugBash 31.03 Platform: iOS This issue is specific to iOS
Projects
None yet
Development

No branches or pull requests