React-native 升级相关类型错误

Ugu*_*gur 7 xcode ios swift react-native

我升级了 react-native

"react": "16.9.0",
"react-native": "0.61.4",
Run Code Online (Sandbox Code Playgroud)

"react": "16.11.0",
"react-native": "0.62.2",
Run Code Online (Sandbox Code Playgroud)

我做了一切都反应原生升级帮助文件

https://react-native-community.github.io/upgrade-helper/?from=0.61.4&to=0.62.2

但我遇到了这些错误

"associated type descriptor for Swift.ExpressibleByFloatLiteral.FloatLiteralType", referenced from:

"associated type descriptor for Swift.ExpressibleByIntegerLiteral.IntegerLiteralType", referenced from:

"value witness table for Builtin.Int32", referenced from:
Run Code Online (Sandbox Code Playgroud)

在此处输入图片说明

mr *_*oni 22

升级到 react-native 0.63.3 后出现同样的错误。

根本原因是我的项目只有目标 C 文件。

解决方案只是在 xcode 中的项目下添加一个空的 swift 文件,您的所有链接错误都将得到解决。

File -> New -> File

Select Swift File
Run Code Online (Sandbox Code Playgroud)

  • 成功了!谢谢! (2认同)