search

Home  >  Q&A  >  body text

ios - 环信SDK和项目的SDK的.a文件有冲突,求解决办法。

导入环信的sdk时 和项目里sdk的.a文件 有冲突。在不删掉原来的.a文件的情况下,还有其他办法解决吗?求大神们帮忙~ /(ㄒoㄒ)/~~

PHP中文网PHP中文网2887 days ago260

reply all(2)I'll reply

  • 怪我咯

    怪我咯2017-04-17 17:39:52

    Try CocoPods, use it to import dependent libraries, it will handle these problems

    reply
    0
  • 迷茫

    迷茫2017-04-17 17:39:52

    Is -all_load added to the other linker flag? If so, find all the libraries that ask you to add this flag, assuming it is called somelib.a, then delete this flag and use another flag: -all_load?如果是的话,找到所有叫你加这个flag的库,假设叫somelib.a,然后把这个flag删掉,使用另一个flag:

    -force_load $(PROJECT_DIR)/path/to/somelib.a

    原因:如果静态库中有category,则需要-ObjC来告诉linker加载这些category。但是64位系统中-ObjC有一个bug:不加载只包含category的静态库,因此引入了-all_load-force_load来解决这个bug。
    -all_load-force_load的作用是一样的,只是all直接作用于所有文件了,force必须加参数,只作用于参数的文件。让你加-all_load

    -force_load $(PROJECT_DIR)/path/to/somelib.a#🎜🎜# #🎜🎜#Reason: If there are categories in the static library, -ObjC is needed to tell the linker to load these categories. However, there is a bug in -ObjC in 64-bit systems: static libraries containing only categories are not loaded, so -all_load and -force_load are introduced. Fix this bug.
    -all_load and -force_load have the same effect, except that all directly acts on all files. Force must add parameters and only acts on the files with parameters. The SDK that asks you to add -all_load must have a category in it. #🎜🎜#

    reply
    0
  • Cancelreply