美文网首页
swift解决framework冲突

swift解决framework冲突

作者: KerwinC | 来源:发表于2019-10-06 03:19 被阅读0次

    1. 拆包

    首先$lipo -info 查看包架构

    ------------------------------------------------

    模拟器架构:

    iPhone 4s – iPhone 5 : i386

    iPhone SE : x86_84

    iPhone5s – iPhone 7 Plus : x86_64

    真机设备包含的cpu架构

    iPhone 3g – iPhone 4s : armv7

    iPhone 5 – iPhone 5c : armv7s

    iPhone SE : arm64

    iPhone 5s – iPhone 7 Plus : arm64

    ------------------------------------------------

    然后$lipo xxxx -thin arm64-output xxxx_arm64.a(xxx是包名 后面的名字自己取就可以 64只是分辨cpu架构)

    再然后把解出来的.a文件搬到一个文件夹里 用$ar -x xxx.a拆出.o文件

    2.把冲突的.o删掉

    3.最后把所有.o重新生成.a文件

    命令:$ libtool -static -o ../xxx.a *.o

    4.重复2 3的操作把所有的冲突文件删完后把他们合成新的framework

    $lipo -create -output xxx(frameworkName) xxx_arm64.a xxx_armv7.a xxx_i386.a xxx_x86_64.a

    5.最后把新的frame替换掉旧的frame

    相关文章

      网友评论

          本文标题:swift解决framework冲突

          本文链接:https://www.haomeiwen.com/subject/zqhmuctx.html