3

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

image-20200409145441860

解决方案

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)

Mac系统版本:10.14.6

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

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

修改方法:

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

修改成:

static BOOL RCTParseUnused(const char **input)
{

  return RCTReadString(input, "attribute((unused))") ||
         RCTReadString(input, "__attribute__((__unused__))") ||
         RCTReadString(input, "__unused");
}

兰俊秋雨
5.1k 声望3.5k 粉丝

基于大前端端技术的一些探索反思总结及讨论