xcode高版本启动RN项目常见错误

xcode编译报错:'config.h' file not found

image-20200409145441860

解决方案node

cd node_modules/react-native/third-party/glog-0.3.4
../../scripts/ios-configure-glog.sh

image-20200409150129405

启动报错:Unknown argument type '__attribute__' in method -[RCTAppState getCurrentAppState:error:]. Extend RCTConvert to support this type.

Simulator Screen Shot - iPhone 11 Pro Max - 2020-04-09 at 15.07.23

个人xcode版本:Version 11.0 (11A420a) react

Mac系统版本:10.14.6 ios

缘由Xcode11(iOS13)中对未使用的接口选择器的参数unused字符串属性进行了更改为了__unused__,致使ReactNative动态收集接口时不能把声明的接口进行导入,运行时没法查找到该接口致使的错误。react-native

解决方案:找到文件/node_modules/react-native/React/Base/RCTModuleMethod.mmxcode

修改方法:this

static BOOL RCTParseUnused(const char **input)
{
  return RCTReadString(input, "__unused") ||
         RCTReadString(input, "__attribute__((unused))");
}

修改为:spa

static BOOL RCTParseUnused(const char **input)
{

  return RCTReadString(input, "attribute((unused))") ||
         RCTReadString(input, "__attribute__((__unused__))") ||
         RCTReadString(input, "__unused");
}
相关文章
相关标签/搜索