我正在使用 React Native 开发一个应用程序并尝试从 React Navigation 5 迁移到 6。为此,我遵循了从 5.x 升级指南中的步骤。
React 和 React Native 的版本如下:
"react": "17.0.2",
"react-native": "0.67.2",
我已经安装了这些软件包:
"@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",
升级软件包后,我在文件夹中运行pod install
命令。ios
如果我运行npx react-native run-ios --simulator="iPhone 13"
命令或使用 Xcode 在设备上运行,我会收到以下错误:
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)
看起来像是libRNScreens.a
从react-native-screens
包裹里拿出来的。
你知道如何解决这个问题吗?