【RN】Erros 汇总

缘起

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

React Native build error: Undefined symbols for architecture x86_64

运行

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
【RN】Erros 汇总_第1张图片

Undefined symbols for architecture x86_64:

方案

  installer.pods_project.build_configurations.each do |config|
    config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
  end

你可能感兴趣的:(前端,react-native,react,native,ios)