今天在build ipa 時發現了missing required architecture arm64 的問題,以前也遇到過,但沒有抄底解決方法,只能再找一次

image003.jpg

上網找stackoverflow , 一大堆資料,整個看傻了。

當然,第一件事是要看一下自己是否support 64 bit

有的人寫,只要把 Build Active Architecture Only set YES, 就解決了。

fHDfK.png

但我個人是不建議改成YES解決問題。。。

這個屬性設置為yes,是為了debug的時候編譯速度更快,它只編譯當前的architecture版本。

而設置為no時,會編譯所有的版本。

這個是設備對應的architecture:

armv7|armv7s|arm64都是ARM處理器的指令集
i386|x86_64 是Mac處理器的指令集

這些指令集在那些設備中有用到呢?
arm64:iPhone6​​s , iphone6​​s plus, iPhone6​​,  iPhone6​​ plus, iPhone5S , iPad Air,  iPad mini2(iPad mini with Retina Display)
armv7s:iPhone5, iPhone5C, iPad4(iPad with Retina Display)
armv7:iPhone4, iPhone4S, iPad, iPad2, iPad3(The New iPad), iPad mini, iPod Touch 3G, iPod Touch4
armv6:iPhone 2G/3G, iPod 1G/2G

i386是針對intel通用微處理器32位處理器
x86_64是針對x86架構的64位處理器

模擬器32位處理器測試需要i386架構,
模擬器64位處理器測試需要x86_64架構,
真機32位處理器需要armv7,或者armv7s架構,
真機64位處理器需要arm64架構。

編譯出的版本是向下兼容的,比如你設置此值為yes,用iphone4編譯出來的是armv7版本的,iphone5也可以運行,但是armv6的設備就不能運行。
 

然後就是看一下,自己那個出問題的lib是不是真的有support arm64 ?

使用 : lipo -info 查看一下

user-Mac:~ user$ lipo -info /Users/user/Library/Developer/Xcode/DerivedData/siplib-atcwqrtbzbmrvkaqozciiogkyxge/Build/Products/Debug-universal/libsiplib.a  

Architectures in the fat file: /Users/liweiqi/Library/Developer/Xcode/DerivedData/siplib-atcwqrtbzbmrvkaqozciiogkyxge/Build/Products/Debug-universal/libsiplib.a are: armv7 i386 armv7s x86_64 arm64 

有arm64 就是support 64-bit唷,沒有的話,請re-build 一下lib.a 囉。

真機測試的話, 資料夾是用Debug-universal or Release-universal唷。

you can build libsiplib.a in xcode, please choose target 'sipliba' first

image1.png 

and then build it, 

please notice the .a file generated should be in the directory Debug-universal or Release-universal, not in the directory Debug-iphoneos or others

image2.png 

 then you need copy this file to overwrite the active libsiplib.a file in the target project.

arrow
arrow

    lionlionchopper 發表在 痞客邦 留言(0) 人氣()