I tried to build a new private cocoapods library which embeds a static library (provided by an external vendor). The static library is composed by two kind of files : XX-libs-simulator.a and XX-libs.a.
When I run
"pod spec lint . --verbose --use-libraries"
I get
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.
When I compile it with my Xcode, I have no issues. I already tried to change the following values :
"VALID ARCHITECTURES" : armv7, arm64 and x86_64, i386
"BUILD ONLY ACTIVE ARCHITECTURES" : both (yes / no)
For your information, the lipo output for the external libs is :
lipo -info libXX.a
libXX.a are: armv7 arm64
lipo -info libXX-simulator.a
libXX-simulator.a are i386 x86_64
How to get pod to compile my library like XCode ?
I didn't have the answer to my question but to avoid this issue I chose to create my own library without cocoapods. I think when you need a particular configuration, it's probably the easiest and the best way to do it manually using the old school methods.