Unable to resolve "./GestureHandlerRootView

I tried to create a simple route(installing all packages including this), but I get an error Unable to resolve "./GestureHandlerRootView" from "node_modules\react-native-gesture-handler\GestureHandler.js" Failed building JavaScript bundle.

import { createStackNavigator } from 'react-navigation-stack';
import { Main } from '../screens/Main';
import { createAppContainer } from 'react-navigation';

const RootStack = createStackNavigator(
  {
    Home: Main
  },
  {
    initialRouteName: 'Home'
  }
);
export const AppContainer = createAppContainer(RootStack);

and the app.js file

import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { AppContainer } from './src/navigation/AppNavigation';
import { Main } from './src/screens/Main';

export default function App() {


  return <AppContainer />;
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#fff',
    alignItems: 'center',
    justifyContent: 'center'
  }
});

Upvotes: 4

Views: 3791

Answers (4)

Edvainas
Edvainas

Reputation: 1

In my case GestureHanderRootView.js existed, but it was cached in gradle. I used this from root direction :

cd android && ./gradlew clean && ./gradlew :app:bundleRelease

Upvotes: 0

jstafford
jstafford

Reputation: 418

Just had same problem. GestureHanderRootView.js was missing from node modules for some reason. For now, I just created the file and copied from here and all was fine:

https://github.com/software-mansion/react-native-gesture-handler/blob/master/GestureHandlerRootView.js

Upvotes: 1

Nono
Nono

Reputation: 161

A new update has just been released.
Reinstall the library to get the new version 1.5.5.
It works for me.

Upvotes: 2

Rodrigo Brun
Rodrigo Brun

Reputation: 121

I just had this issue, initializing a fresh RN app.

I took a look to my old projects, and I saw that react-native-gesture-handler is updated to 1.5.4 now.. After some search, trying to fix this problem, I just downgraded to version 1.5.3 of gesture handler, and follow up with the normal installation.

I'm also using react-navigation and react-navigation-stack. If possible I'll try again with the updated version.

Upvotes: 3

Related Questions