“未定义符号:Swift.ExpressibleByFloatLiteral 的协议描述符";在 macOS Big Sur 上安装 React Native 时出现问题 [英] "Undefined symbol: protocol descriptor for Swift.ExpressibleByFloatLiteral" issue while installing react native on macOS Big Sur

查看:471
本文介绍了“未定义符号:Swift.ExpressibleByFloatLiteral 的协议描述符";在 macOS Big Sur 上安装 React Native 时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在我的系统上安装 React Native,但发现它无法安装该模板错误所需的 CocoaPods 依赖项.

I was trying to install React Native on my system, and found that it failed to install CocoaPods dependencies which is required by that template error.

sudo arch -x86_64 gem install ffi 修复了这个问题,但最终出现了 event-config.h"找不到文件 错误.

sudo arch -x86_64 gem install ffi fixed this issue but ended up with event-config.h" file not found error.

我将 pod 文件中已更改的鳍状肢版本更改为 use_flipper!({'Flipper'=>'0.76.0'}) 然后我遇到了上面提到的错误.对此问题的任何帮助将不胜感激.

I changed the changed the flipper version in pod file to use_flipper!({'Flipper'=>'0.76.0'}) and then I reached to the error mentioned above. Any help on this issue would be appreciated.

node version : 15.10.0
react-native version: 0.63.4
Xcode version: 12.4

错误描述如下:

Showing Recent Messages

Could not find or use auto-linked library 'swiftCoreGraphics'
Could not find or use auto-linked library 'swiftUIKit'
Could not find or use auto-linked library 'swiftDarwin'
Could not find or use auto-linked library 'swiftFoundation'
Could not find or use auto-linked library 'swiftMetal'
Could not find or use auto-linked library 'swiftObjectiveC'
Could not find or use auto-linked library 'swiftCoreFoundation'
Could not find or use auto-linked library 'swiftDispatch'
Could not find or use auto-linked library 'swiftCoreImage'
Could not find or use auto-linked library 'swiftQuartzCore'
Could not find or use auto-linked library 'swiftCore'
Could not find or use auto-linked library 'swiftSwiftOnoneSupport'
Undefined symbol: protocol descriptor for Swift.ExpressibleByFloatLiteral
Undefined symbol: associated type descriptor for Swift.ExpressibleByIntegerLiteral.IntegerLiteralType

Undefined symbol: associated conformance descriptor for Swift.ExpressibleByIntegerLiteral.Swift.ExpressibleByIntegerLiteral.IntegerLiteralType: Swift._ExpressibleByBuiltinIntegerLiteral

Undefined symbol: method descriptor for Swift.ExpressibleByFloatLiteral.init(floatLiteral: A.FloatLiteralType) -> A

Undefined symbol: protocol descriptor for Swift.ExpressibleByIntegerLiteral
Undefined symbol: value witness table for Builtin.Int32
Undefined symbol: __swift_FORCE_LOAD_$_swiftCoreImage
Undefined symbol: associated type descriptor for Swift.ExpressibleByFloatLiteral.FloatLiteralType
Undefined symbol: __swift_FORCE_LOAD_$_swiftQuartzCore
Undefined symbol: __swift_FORCE_LOAD_$_swiftDispatch
Undefined symbol: method descriptor for Swift.ExpressibleByIntegerLiteral.init(integerLiteral: A.IntegerLiteralType) -> A
Undefined symbol: __swift_FORCE_LOAD_$_swiftCoreFoundation
Undefined symbol: protocol witness table for Swift.Int : Swift._ExpressibleByBuiltinIntegerLiteral in Swift
Undefined symbol: __swift_FORCE_LOAD_$_swiftObjectiveC
Undefined symbol: __swift_FORCE_LOAD_$_swiftCoreGraphics
Undefined symbol: _swift_getForeignTypeMetadata
Undefined symbol: __swift_FORCE_LOAD_$_swiftFoundation
Undefined symbol: associated conformance descriptor for Swift.ExpressibleByFloatLiteral.Swift.ExpressibleByFloatLiteral.FloatLiteralType: Swift._ExpressibleByBuiltinFloatLiteral
Undefined symbol: __swift_FORCE_LOAD_$_swiftUIKit
Undefined symbol: __swift_FORCE_LOAD_$_swiftMetal
Undefined symbol: Swift.Float.init(Swift.Double) -> Swift.Float
Undefined symbol: __swift_FORCE_LOAD_$_swiftDarwin
Undefined symbol: protocol witness table for Swift.Float : Swift._ExpressibleByBuiltinFloatLiteral in Swift

推荐答案

如果您使用的是 M1 mac,则需要排除架构 arm64.

You need to exclude architecture arm64 if you are using M1 mac.

也在 pod 文件的末尾添加这段代码

Also add this code at the end of the pod file

post_install do |installer|
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings["ONLY_ACTIVE_ARCH"] = "NO"
      end
    end
  end

执行 pod install,清理 build 文件夹并重新启动 build 即可解决问题.

Do pod install, Clean the build folder and restart the build it will resolve the issue.

这篇关于“未定义符号:Swift.ExpressibleByFloatLiteral 的协议描述符";在 macOS Big Sur 上安装 React Native 时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆