21

enter image description here

Getting this error when adding react-navigation-drawer to my expo project, any idea how to fix this?

user13142973
  • 625
  • 1
  • 6
  • 11

4 Answers4

26

Faced this error few days back, I was able to fix it by running:

expo install react-native-gesture-handler react-native-reanimated react-native-screens react-native-safe-area-context @react-native-community/masked-view
Goskula Jayachandra
  • 3,931
  • 2
  • 12
  • 22
  • Tried that able to fix the above error but getting a new error Unable to resolve "./useValue" from "node_modules\react-native-reanimated\src\Animated.js" – user13142973 Aug 08 '20 at 13:26
  • 1
    Check this https://stackoverflow.com/questions/63215154/react-native-reanimated-unable-to-resolve-usevalue this will fix your error – Goskula Jayachandra Aug 08 '20 at 13:31
  • Additonally, after installing the correct packages, I cleared the expo cache using `expo start -c` and cleared the cache on my iOS device by opening the simulator Device > Erase All Content and Settings. Worked like a charm. – JoshuaHew Nov 01 '20 at 20:24
  • @GoskulaJayachandra what made you decide to fix "unrecognized operator abs" by installing the packages react-native-gesture-handler react-native-reanimated react-native-screens react-native-safe-area-context @react-native-community/masked-view ? – chrnybo Aug 16 '21 at 12:46
4

It is library version issue. Don't use 'yarn add react-native-gesture-handler react-native-reanimated' It will add react-native-reanimated@1.13.0 react-native-gesture-handler@1.7.0

Use 'expo install react-native-gesture-handler react-native-reanimated' It will add react-native-gesture-handler@~1.6.0 react-native-reanimated@~1.9.0

0

Close your IDE. Restart your computer.
Open your project, re-install you package (npm install).
re-run your project (react-native run-android)

chris
  • 194
  • 2
  • 10
  • 2
    This answer is too general to address the problem and does not provide much benefit to those seeking a solution to the problem. – Kendall May 15 '21 at 19:43
0

It's because some of your installed packages are not matched with current version of Expo

In your terminal you will see a warning like

  • expo-av - expected version range: ~8.2.1 - actual version installed: ~8.7.0
  • expo-constants - expected version range: ~9.1.1 - actual version installed: ~9.3.3

To solve this issue you have to update all the packages according to the current expo version by running this command

expo install packageName@packageVersion   // expo install expo-av@8.2.1