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)
...
 
以上情况如何处理,谢谢
共6个回复

zl

2015-10-13 09:57

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

roller

2015-10-13 10:18

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

zl

2015-10-13 10:27

lite版  other linker 改成force_load  

roller

2015-10-13 10:42

不行还是有同样问题 Ld [$Project] normal x86_64 cd [$Project_src_dir] export IPHONEOS_DEPLOYMENT_TARGET=8.1 export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk -L[$build_dir]/Build/Products/Debug-iphonesimulator -L[$Project_src_dir]/3rdParty/MiSDK -L[$Project_src_dir]/3rdParty/EaseMobSDK/lib -F[$build_dir]/Build/Products/Debug-iphonesimulator -filelist ... -Xlinker -no_pie -Xlinker -rpath -Xlinker @executable_path/Frameworks -mios-simulator-version-min=8.1 -Xlinker -objc_abi_version -Xlinker 2 -ObjC -force_load [$Project_src_dir]/3rdParty/EaseMobSDK/lib/libEaseMobClientSDKLite.a -fobjc-arc -fobjc-link-runtime -lEaseMobClientSDKLite -lstdc++.6.0.9 -liconv -framework CFNetwork -framework AddressBookUI -framework AddressBook -framework AssetsLibrary -lresolv -lxml2 -lz -framework SystemConfiguration -framework MobileCoreServices -framework CoreTelephony -lMiPushSDK -lsqlite3.0 -Xlinker -dependency_info -Xlinker ... -o [$Project] duplicate symbol _OBJC_CLASS_$_XMPPElement in: [$Project_src_dir]/3rdParty/EaseMobSDK/lib/libEaseMobClientSDKLite.a(XMPPElement.o) [$Project_src_dir]/3rdParty/MiSDK/libMiPushSDK.a(XMPPElement.o) duplicate symbol _OBJC_METACLASS_$_XMPPElement in: [$Project_src_dir]/3rdParty/EaseMobSDK/lib/libEaseMobClientSDKLite.a(XMPPElement.o) [$Project_src_dir]/3rdParty/MiSDK/libMiPushSDK.a(XMPPElement.o) ...

zl

2015-10-13 17:42

other linker 截图看下    

roller

2015-10-13 18:04

[attach]1437[/attach] 上个回复中给出的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

2015-10-14 08:06

您这小米推送的SDK与我们环信SDK,XMPPElement.o部分有重复,您可以对这个文件处理一下,或者换其他推送试试。
点击此处继续提问与开发者们互动

申请试用

提交后工作人员会尽快与您联系进行功能演示
技术咨询已转移到管理后台,请先登录

即时通讯云使用者请在应用详情页面咨询
客服云使用者请进入管理员模式咨询

×

在线咨询

电话咨询

技术咨询

免费试用