一、問題描述
當我用cocoapods導入react-native庫后,項目報錯
Library not found for -lPods-test.a
linker command failed with exit code 1 (use -v to see invocation)
二、解決方法
修改Build-Settings->Build Active Architecture Only中的Debug為Yes,問題解決
三、
pods導入的庫只支持armv7版本的architecture,所以將Debug設置為Yes就可以編譯通過。
這個屬性設置為yes,是為了debug的時候編譯速度更快,它只編譯當前的architecture版本。
而設置為no時,會編譯所有的版本。
這個是設備對應的architecture:
armv6:iPhone 2G/3G,iPod 1G/2G
armv7:iPhone 3GS/4/4s,iPod 3G/4G,iPad 1G/2G/3G
armv7s:iPhone5, iPod5
編譯出的版本是向下兼容的,比如你設置此值為yes,用iphone4編譯出來的是armv7版本的,iphone5也可以運行,但是armv6的設備就不能運行。
所以,一般debug的時候可以選擇設置為yes,release的時候要改為no,以適應不同設備。