I am developing an app with React Native and trying to migrate from React Navigation 5 to 6. For this I have followed the steps that come in the Upgrading from 5.x guide.
The versions of React and React Native are these:
"react": "17.0.2",
"react-native": "0.67.2",
I have installed these packages:
"@react-navigation/bottom-tabs": "^6.2.0",
"@react-navigation/native": "^6.0.8",
"@react-navigation/stack": "^6.1.1",
"react-native-safe-area-context": "^3.4.1",
"react-native-screens": "^3.12.0",
"react-native-tab-view": "^3.1.1",
After upgrading the packages I ran pod install
command in ios
folder.
If I run npx react-native run-ios --simulator="iPhone 13"
command or I run on a device using Xcode, I get this error:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_RNSSearchBar", referenced from:
objc-class-ref in libRNScreens.a(RNSScreenStackHeaderConfig.o)
"_OBJC_CLASS_$_RNSScreenStackAnimator", referenced from:
objc-class-ref in libRNScreens.a(RNSScreenStack.o)
"_OBJC_CLASS_$_RNSScreenWindowTraits", referenced from:
objc-class-ref in libRNScreens.a(RNSScreen.o)
objc-class-ref in libRNScreens.a(RNSScreenStack.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
It looks like libRNScreens.a
is from the react-native-screens
package.
Do you know how to solve this problem?
The easiest way to solve the problem in my case has been to downgrade react-native-screens
library to version 3.11.1. Now it runs without problems.