0

I have created a simple app with a hamburger menu to show the problem. This code runs fine in the simulator. It only crashes when testing on a Testflight build on iOS. The crash happens immediately after launching. What am I missing?

The error I am seeing on Sentry is

requireNativeComponent: "RNSScreen" was not found in the UIManager.

I have put import 'react-native-gesture-handler' as the first line in App.tsx

App.tsx

import 'react-native-gesture-handler';
import { View, Text } from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { createDrawerNavigator } from '@react-navigation/drawer';

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

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

const Drawer = createDrawerNavigator();

function MyDrawer() {
  return (
    <Drawer.Navigator>
      <Drawer.Screen name="Feed" component={Feed} />
      <Drawer.Screen name="Article" component={Article} />
    </Drawer.Navigator>
  );
}

export default function App() {
  return (
    <NavigationContainer>
      <MyDrawer />
    </NavigationContainer>
  );
}

package.json

{
  "name": "test_app",
  "version": "1.0.0",
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web",
    "eject": "expo eject",
    "test": "jest --watchAll"
  },
  "jest": {
    "preset": "jest-expo"
  },
  "dependencies": {
    "@expo/vector-icons": "^12.0.0",
    "@react-navigation/bottom-tabs": "^6.0.5",
    "@react-navigation/drawer": "^6.4.1",
    "@react-navigation/native": "^6.0.2",
    "@react-navigation/native-stack": "^6.1.0",
    "expo": "~44.0.0",
    "expo-asset": "~8.4.4",
    "expo-constants": "~13.0.0",
    "expo-font": "~10.0.4",
    "expo-linking": "~3.0.0",
    "expo-splash-screen": "~0.14.0",
    "expo-status-bar": "~1.2.0",
    "expo-updates": "~0.11.7",
    "expo-web-browser": "~10.1.0",
    "react": "17.0.1",
    "react-dom": "17.0.1",
    "react-native": "0.64.3",
    "react-native-gesture-handler": "~2.1.0",
    "react-native-reanimated": "~2.3.1",
    "react-native-safe-area-context": "3.3.2",
    "react-native-screens": "~3.10.1",
    "react-native-web": "0.17.1"
  },
  "devDependencies": {
    "@babel/core": "^7.12.9",
    "@types/react": "~17.0.21",
    "@types/react-native": "~0.64.12",
    "jest": "^26.6.3",
    "jest-expo": "~44.0.1",
    "react-test-renderer": "17.0.1",
    "typescript": "~4.3.5"
  },
  "private": true
}

slingkid
  • 101
  • 2
  • 6
  • do you have any logs? its a little hard to know what is happening without that, did you try put the `import 'react-native-gesture-handler';` in the `index.js` instead App.tsx? – enzou May 04 '22 at 13:41
  • I added Sentry and this is what is reportedrequireNativeComponent: "RNSScreen" was not found in the UIManager. – slingkid May 05 '22 at 19:12
  • This is a managed expo project so there is no index.js file – slingkid May 05 '22 at 19:12
  • Im not sure how the config expo is, in this post are many workarounds might can help you https://stackoverflow.com/q/66921263/12061204 – enzou May 05 '22 at 21:09
  • Run `expo upgrade 44.0.0` you are using non compatible packages, follow the questionnaires given by the cli to solve the issue. – Rajendran Nadar May 10 '22 at 05:29
  • 1
    if you look at package.json, I am already running expo 44.0.0 – slingkid May 11 '22 at 17:18
  • But you packages are not compatible with SDK 44 that cmd will install correct packages. If you are ok for SDK 45 it will also solve the issue. – Rajendran Nadar May 12 '22 at 08:04

0 Answers0