环信 之 iOS 客户端集成二:配置库

1. 添加依赖库

Build Phases → Link Binary With Libraries

  • MobileCoreServices.framework
  • CFNetwork.framework
  • libEaseMobClientSDKLite.a
  • libsqlite3.dylib
  • libstdc++.6.0.9.dylib
  • libz.dylib
  • libiconv.dylib
  • libresolv.dylib
  • libxml2.dylib

  如果使用的是xcode7,后缀为tbd

  使用cocoapods ,就不需要libEaseModClientSDKLite或者libEaseModClientSDK

 

2. 添加 -ObjC

2.1. 添加

  向Build Settings → Linking → Other Linker Flags 中 添加-ObjC(注意大小写)

2.2. 冲突

  如果项目中使用-ObjC有冲突,可以添加-force_load来解决。

格式为: -force_load[空格]EaseMobSDK/lib/libEaseMobClientSDKLite.a(静态库的路径)

  • step1. 先添加一个-force_load

  • step2. 将静态库拖动到上一步添加的-force_load下面

  • step3. 最终效果

 

 如果在真机上运行,出现错误:

clang: error: linker command failed with exit code 1 (use -v to see invocation)

does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture arm64

 

则需要 build setting中bitcode设为NO

 

posted on 2015-12-30 10:21  大木哥  阅读(248)  评论(0编辑  收藏  举报

导航