1.在制作.framework时要支持不同的架构
真机 iphone4系列: armv7
iphone5,iphone5c :armv7s
iphone5s-7plus :arm64
模拟器 iphone4s-5-5c :i386
iphone5s-7plus :x86_64
2.查看xxx.framework支持的架构
下在终端上输入:lipo -info 文件路径/xxx.framework/xxx


注意:查看.framework和.a 是有区别的 lipo -info 拖入.a文件路径 回车没有问题但是查看.framework时报错,一定要向上图那样双击打开.framework里面的可执行文件(黑色的那个)拖到命令行 回车,这里网上好多都没有详细说明

3.把所需要的架构合并好后的一个可执行文件替换掉原来的那个
lipo -create 文件路径/xxx.framework/xxx 另一个文件路径/xxx.framework/xxx -output 放在哪里的文件路径/合并后的文件名
但是不知道为什还是哪里配置有问题,我用的是Swift创建的.framework 导入到Swift工程中正常没有问题,但是导入到OC工程中运行崩溃 ~~~~~~~~

网友评论