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");
}
相關文章
相關標籤/搜索