gpt4 book ai didi

ios - Apple Mach Linker 未找到,缺少依赖 React

转载 作者:行者123 更新时间:2023-11-29 05:33:33 24 4
gpt4 key购买 nike

运行react-native link来链接所有需要的库后,Xcode不会构建项目的iOS版本。问题出在链接的react-native-vector-icons库上。

我正在使用 .workspace 文件并使用 Podfile 来管理 iOS 的依赖项。我已经尝试了库的手动链接和 react native 链接,但我得到的错误是

ld: framework not found React clang: error: linker command failed with exit code 1 (use -v to see invocation)

`Showing Recent Messages
Ld /Users/../ProjectX-agmovfcichistxhkaamivrarvpqp/Build/Products/Debug-iphonesimulator/RNVectorIcons/RNVectorIcons.framework/RNVectorIcons normal x86_64
cd /../ios/Pods
export IPHONEOS_DEPLOYMENT_TARGET=9.0
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk -L/../ProjectX-agmovfcichistxhkaamivrarvpqp/Build/Products/Debug-iphonesimulator/RNVectorIcons -F/../ProjectX-agmovfcichistxhkaamivrarvpqp/Build/Products/Debug-iphonesimulator/RNVectorIcons -F/../ProjectX-agmovfcichistxhkaamivrarvpqp/Build/Products/Debug-iphonesimulator/DoubleConversion -F/../ProjectX-agmovfcichistxhkaamivrarvpqp/Build/Products/Debug-iphonesimulator/Folly -F/../ProjectX-agmovfcichistxhkaamivrarvpqp/Build/Products/Debug-iphonesimulator/React -F/../ProjectX-agmovfcichistxhkaamivrarvpqp/Build/Products/Debug-iphonesimulator/glog -F/../ProjectX-agmovfcichistxhkaamivrarvpqp/Build/Products/Debug-iphonesimulator/yoga -filelist /../ProjectX-agmovfcichistxhkaamivrarvpqp/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RNVectorIcons.build/Objects-normal/x86_64/RNVectorIcons.LinkFileList -install_name @rpath/RNVectorIcons.framework/RNVectorIcons -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -mios-simulator-version-min=9.0 -dead_strip -Xlinker -object_path_lto -Xlinker /../ProjectX-agmovfcichistxhkaamivrarvpqp/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RNVectorIcons.build/Objects-normal/x86_64/RNVectorIcons_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -fprofile-instr-generate -framework Foundation -framework React -compatibility_version 1 -current_version 1 -Xlinker -dependency_info -Xlinker /../ProjectX-agmovfcichistxhkaamivrarvpqp/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RNVectorIcons.build/Objects-normal/x86_64/RNVectorIcons_dependency_info.dat -o /../ProjectX-agmovfcichistxhkaamivrarvpqp/Build/Products/Debug-iphonesimulator/RNVectorIcons/RNVectorIcons.framework/RNVectorIcons

ld: framework not found React
clang: error: linker command failed with exit code 1 (use -v to see invocation)
`

我希望 iOS 版本能够成功构建。

最佳答案

我相信react-native-link永远不应该单独运行,因为它导致的中断比实际执行任何操作都多。

  1. 重置项目的配置,即取消链接并卸载所有依赖项,并删除 ios/build文件夹。
  2. 再次安装后,如果您坚持使用自动链接,请运行 react-native link <library_name>对于每一个。

  3. 或者,您可以尝试手动链接过程。

IOS手动库安装步骤

  • 添加 .xcodeproj将组件添加到 XCode 中的 Libraries 文件夹
  • 添加 lib{library_name}.a文件到目标项目中常规部分下的链接框架和库。

附加说明

  • 确保您已检查字体是否已复制到构建阶段的复制捆绑资源中。如果没有,请重新检查手动配置步骤。

  • 确保终止打包程序并重新运行以使更改生效。

关于ios - Apple Mach Linker 未找到,缺少依赖 React,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57287286/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com