欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  移动技术

Xcode版本问题:Unknown argument type ‘__attribute__‘ in method -[RCTAppState getCurrentAppState:error:].

程序员文章站 2022-04-19 15:05:14
遇到的问题:Xcode版本升级后,在Xcode上点击build时遇到以下问题:Unknown argument type '__attribute__' in method -[RCTAppState getCurrentAppState:error:]. Extend RCTConvert to support this type.如图:解决的方法:1.在Xcode中打开:Xcode打开RCTModuleMethod.mm文件:路径Libraries->React.xcodeproj-...

遇到的问题:

Xcode版本升级后,在Xcode上点击build时遇到以下问题:

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

如图:
Xcode版本问题:Unknown argument type ‘__attribute__‘ in method -[RCTAppState getCurrentAppState:error:].
解决的方法:
1.在Xcode中打开:Xcode打开RCTModuleMethod.mm文件:路径Libraries->React.xcodeproj->React->Base ->RCTModuleMethod.mm
Xcode版本问题:Unknown argument type ‘__attribute__‘ in method -[RCTAppState getCurrentAppState:error:].
2.更改代码:
Xcode版本问题:Unknown argument type ‘__attribute__‘ in method -[RCTAppState getCurrentAppState:error:].

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

3.clean Xcode :click product->clean or shift+cmd+k

4.重新build,跑的贼溜

本文地址:https://blog.csdn.net/koufulong/article/details/107279920