【RN】解决:React Native build error: Undefined symbols for architecture x86

【RN】解决:React Native build error: Undefined symbols for architecture x86,第1张

缘起

当看到这边文章的时候Jeverson已经从NativeiOS渐行渐远了。从另外一方面来说,拥抱变化,向跨平台ReactNative进了一小步。废话少来,直接抛出问题。

运行
npm run ios
yarn ios
结果
** BUILD FAILED **


The following build commands failed:
        Ld /Users/jeversonjee/Library/Developer/Xcode/DerivedData/rnTemplate-dyxbknpwkimmmtbfkrlqejlhshic/Build/Products/Debug-iphonesimulator/rnTemplate.app/rnTemplate normal (in target 'rnTemplate' from project 'rnTemplate')
(1 failure)

error Command failed with exit code 1.
分析

这个结果,告诉我编译iOS代码的时候编译失败了;OK使用Xcode打开应用,我们来看看具体的错误是什么。

ld: warning: directory not found for option '-L/Users/jeversonjee/Downloads/XXX项目名称/ios/WechatSDK'
ld: warning: Could not find or use auto-linked library 'swift_Concurrency'
ld: warning: Could not find or use auto-linked library 'swiftFileProvider'
ld: warning: Could not find or use auto-linked library 'swiftDataDetection'
Undefined symbols for architecture x86_64:
  "__swift_FORCE_LOAD_$_swiftDataDetection", referenced from:
      __swift_FORCE_LOAD_$_swiftDataDetection_$_YogaKit in libYogaKit.a(YGLayoutExtensions.o)
     (maybe you meant: __swift_FORCE_LOAD_$_swiftDataDetection_$_YogaKit)
  "__swift_FORCE_LOAD_$_swiftFileProvider", referenced from:
      __swift_FORCE_LOAD_$_swiftFileProvider_$_YogaKit in libYogaKit.a(YGLayoutExtensions.o)
     (maybe you meant: __swift_FORCE_LOAD_$_swiftFileProvider_$_YogaKit)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Undefined symbol: __swift_FORCE_LOAD_$_swiftDataDetection

Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider

解决方案

rnTemplate(Target) -> BuildPhase -> LinkBinary With Libraries -> + -> libSwiftWebKit.tbd

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/989532.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-21
下一篇 2022-05-21

发表评论

登录后才能评论

评论列表(0条)

保存