問題:真機模擬器庫無法合並,報錯:have the same architectures (arm64) and can't be in the same fat output file
分析:Xcode12之前:編譯模擬器靜態庫支持i386 x86_64兩架構;編譯真機靜態庫支持armv7 arm64兩架構。在使用lipo -create -output命令可以將兩個庫合並成一個支持模擬器和真機i386 x86_64 armv7 arm64四種架構的胖子庫。但是現在Xcode12編譯的模擬器靜態庫也支持了arm64,導致出現真機庫和模擬器庫不能合並的問題。【have the same architectures (arm64) and can't be in the same fat output file】
解決辦法:
1.如果有靜態庫工程:在工程里面進行如下設置
Build Settings -> Excluded Architectures里按照這樣設置一下,再編譯合並就不會報錯了。


2.如果手里只有.a或.framework文件,使用lipo remove命令將模擬器庫的arm64架構移除
lipo XXX.a -remove arm64 -output XXX.a