IOS SDK 客户端编译错误[与2.1 版MiPushSDK同时编译(1.7版时无以上问题)]

我刚开始用环信,原来项目同时使用MiPush,
当Other Linker Flags 只包含-ObjC时有如下错误:
duplicate symbol _OBJC_CLASS_$_XMPPElement in:
    [$Project]/Lighting/3rdParty/EaseMobSDK/lib/libEaseMobClientSDK.a(XMPPElement.o)
    [$Project]/Lighting/3rdParty/MiSDK/libMiPushSDK.a(XMPPElement.o)
duplicate symbol _OBJC_METACLASS_$_XMPPElement in:
    [$Project]/Lighting/3rdParty/EaseMobSDK/lib/libEaseMobClientSDK.a(XMPPElement.o)
    [$Project]/Lighting/3rdParty/MiSDK/libMiPushSDK.a(XMPPElement.o)
duplicate symbol _OBJC_IVAR_$_DDListEnumerator.numElements in:
    [$Project]/Lighting/3rdParty/EaseMobSDK/lib/libEaseMobClient
...
当增加-force_load时[模拟器下]
Undefined symbols for architecture x86_64:
  "webrtc::FIRFilterSSE2::FIRFilterSSE2(float const*, unsigned long, unsigned long)", referenced from:
      webrtc::FIRFilter::Create(float const*, unsigned long, unsigned long) in libEaseMobClientSDK.a(fir_filter.o)
[真机下]
duplicate symbol _WebRtcNsx_Create in:
    [$Project]/3rdParty/EaseMobSDK/lib/libEaseMobClientSDK.a(noise_suppression_x.o)
duplicate symbol _WebRtcNsx_Free in:
    [$Project]/3rdParty/EaseMobSDK/lib/libEaseMobClientSDK.a(noise_suppression_x.o)
duplicate symbol _WebRtcNsx_Init in:
    [$Project]/3rdParty/EaseMobSDK/lib/libEaseMobClientSDK.a(noise_suppression_x.o)
...
duplicate symbol _OBJC_CLASS_$_XMPPElement in:
    [$Project]/3rdParty/EaseMobSDK/lib/libEaseMobClientSDK.a(XMPPElement.o)
    [$Project]/3rdParty/MiSDK/libMiPushSDK.a(XMPPElement.o)
duplicate symbol _OBJC_METACLASS_$_XMPPElement in:
    [$Project]/3rdParty/EaseMobSDK/lib/libEaseMobClientSDK.a(XMPPElement.o)
    [$Project]/3rdParty/MiSDK/libMiPushSDK.a(XMPPElement.o)
duplicate symbol _OBJC_IVAR_$_DDListEnumerator.numElements in:
    [$Project]/3rdParty/EaseMobSDK/lib/libEaseMobClientSDK.a(DDList.o)
    [$Project]/3rdParty/MiSDK/libMiPushSDK.a(DDList.o)
...
 
以上情况如何处理,谢谢
已邀请:

zl

赞同来自:

项目中有用到实时语音和实时视频吗?

roller

赞同来自:

暂时没用到,但是使用Lite版本仍有duplicate symbol _OBJC_CLASS_$_XMPPElement类型的错误

zl

赞同来自:

lite版  other linker 改成force_load
 

zl

赞同来自:

other linker 截图看下
 
 

roller

赞同来自:

otherLinker.png

上个回复中给出的Ld命令参数同样可以看到
 -ObjC -force_load [$Project_src_dir]/3rdParty/EaseMobSDK/lib/libEaseMobClientSDKLite.a
 
看起来是MiPush和EaseMobSDK都使用了XMPP协议通信,又恰巧使用同样的无前缀命名的文件造成包重名,或是都使用了XMPPFramework这个第三方库
我暂时只能改成使用1.7版的MiPushSDK,在other Linker Flags只为-ObjC的情况,能编译通过[目前只是把环信的SDK加入依赖链,还没具体使用环信的API,还不清楚具体使用时是否会有问题]

donghai

赞同来自:

您这小米推送的SDK与我们环信SDK,XMPPElement.o部分有重复,您可以对这个文件处理一下,或者换其他推送试试。

要回复问题请先登录注册

知识价值的认可,源自您的赞赏

扫描二维码,你的支付将由imGeek代收后转给对方

×