Xcode 升级 React Native Unknown argument type '__attribute__' in method 解决方案
最近MacOS系统更新,顺便把XCode的版本也进行了升级,但升级之后出现了错误:
[RCTModuleMethod.mm:376] Unknown argument type '__attribute__' in method -[RCTLinkingManager getInitialURL:reject:]. Extend RCTConvert to support this type.
解决方案
参考这个issue:https://github.com/facebook/react-native/issues/25138
解决见这个PR:https://github.com/facebook/react-native/pull/25146
在 React/Base/RCTModuleMethod.mm
中的 RCTParseUnused
方法添加一行代码
static BOOL RCTParseUnused(const char **input)
{
return RCTReadString(input, "__attribute__((unused))") ||
RCTReadString(input, "__attribute__((__unused__))") ||
RCTReadString(input, "__unused");
}