react-native-jmessage插件ios报错的问题



  • 使用了react-native-jmessage插件,ios编译时一直报错‘NSJSONSerialization+JSONString.h’找不到
    ,插件是用npm直接安装的,没做任何修改,插件里是这样写的
    RCTJMessage.h里有这样一段导入,就是这里一直报错
    #import <Foundation/Foundation.h>
    #import <UIKit/UIKit.h>
    #import <JMessage/JMessage.h>
    #import <JMessage/JMessageDelegate.h>
    #import "NSJSONSerialization+JSONString.h"

    #if __has_include("RCTEventEmitter.h")
    #import "RCTEventEmitter.h"
    #elif __has_include(<React/RCTEventEmitter.h>) // back compatibility for RN version < 0.40
    #import <React/RCTEventEmitter.h>
    #else
    #import "React/RCTEventEmitter.h" // Required when used as a Pod in a Swift project
    #endif
    User Header Search Paths有加入"$(SRCROOT)/RCTJMessage/"
    NSJSONSerialization+JSONString.h文件的内容是
    #import <Foundation/Foundation.h>

    @interface NSJSONSerialization (JSONString)

    • (NSString*) stringWithJSONObject:(NSData *)data options:(NSJSONReadingOptions)opt error:(NSError **) error;
      @end

登录后回复