2016-05-17 90 views
1

我試圖構建一個嵌入靜態庫(由外部供應商提供)的新的私有cocoapods庫。靜態庫由兩種文件組成:XX-libs-simulator.a和XX-libs.a。使用靜態庫創建私有cocoapods

當我運行

"pod spec lint . --verbose --use-libraries" 

我得到

ld: symbol(s) not found for architecture x86_64 
clang: error: linker command failed with exit code 1 (use -v to see invocation) 

** BUILD FAILED ** 

The following build commands failed: 
    Ld /Users/damien/Library/Developer/Xcode/DerivedData/App-fvzzowxkmpidjrgpraveufngzgnl/Build/Intermediates/App.build/Release-iphonesimulator/App.build/Objects-normal/x86_64/App normal x86_64 
(1 failure) 
-> MyOwnLibrary (1.0.1) 
    - ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code. 
    - NOTE | [iOS] xcodebuild: ld: warning: ignoring file MyOwnLibrary/MyOwnLibrary/ExternalLibs/XX-libs/libXX-1.1.5.a, missing required architecture i386 in file MyOwnLibrary/MyOwnLibrary/ExternalLibs/XX-libs/libXX-1.1.5.a (2 slices) 
    - NOTE | [iOS] xcodebuild: ld: warning: ignoring file MyOwnLibrary/MyOwnLibrary/ExternalLibs/XX-libs/libXXB-2.11.1.a, missing required architecture i386 in file MyOwnLibrary/MyOwnLibrary/ExternalLibs/XX-libs/libXXB-2.11.1.a (2 slices) 
    - NOTE | [iOS] xcodebuild: ld: warning: ignoring file MyOwnLibrary/MyOwnLibrary/ExternalLibs/XX-libs/libXX-1.1.5.a, missing required architecture x86_64 in file MyOwnLibrary/MyOwnLibrary/ExternalLibs/XX-libs/libXX-1.1.5.a (2 slices) 
    - NOTE | [iOS] xcodebuild: ld: warning: ignoring file MyOwnLibrary/MyOwnLibrary/ExternalLibs/XX-libs/libXXB-2.11.1.a, missing required architecture x86_64 in file MyOwnLibrary/MyOwnLibrary/ExternalLibs/XX-libs/libXXB-2.11.1.a (2 slices) 
    - NOTE | [iOS] xcodebuild: clang: error: linker command failed with exit code 1 (use -v to see invocation) 

Analyzed 1 podspec. 

當我與我的Xcode編譯它,我沒有問題。我已經試圖改變以下值:

  • 「VALID體系結構」[:ARMv7的,arm64和x86_64,i386的

  • 「只建ACTIVE體系結構」[:兩者(是/否)

爲了您的信息,該脂輸出外部庫是:

lipo -info libXX.a 
libXX.a are: armv7 arm64 

lipo -info libXX-simulator.a 
libXX-simulator.a are i386 x86_64 

如何讓pod像XCode一樣編譯我的庫?

回答

0

我沒有我的問題的答案,但爲了避免這個問題,我選擇創建我自己的圖書館沒有cocoapods。我認爲當你需要一個特定的配置時,它可能是使用舊派方法手動完成它的最簡單和最好的方法。