美文网首页初见
React Native 0.50在xcode 11上崩溃问题

React Native 0.50在xcode 11上崩溃问题

作者: visen_Lu | 来源:发表于2020-01-14 16:30 被阅读0次
    Unknown argument type '__attribute__' in method -
    [RCTAppState getCurrentAppState:error:]. 
    Extend RCTConvert to support this type
    
    Exception '*** -[__NSArrayM objectAtIndexedSubscript:]: 
    index 1 beyond bounds [0 .. 0]' was thrown while invoking getCurrentAppState on target AppState with params 
    (
        2,
        3
    )
    

    修改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");
    }
    

    相关文章

      网友评论

        本文标题:React Native 0.50在xcode 11上崩溃问题

        本文链接:https://www.haomeiwen.com/subject/vijaactx.html