IOS libtool: file: -lPods-YHOnePaySDK is not an object file (not allowed in a library)

I have an iOS static library that isn't building. It uses cocoapods to manage a number of dependencies as well as being a pod itself.

What's interesting is that when the library is used in a client project as a pod everything compiles fine.

Here is the output of my error:

Libtool /Users/Bob/Library/Developer/Xcode/DerivedData/MyLibrary-fxukfghqxapkcqcnjjhmhecxahhg/Build/Intermediates/MyLibrary.build/Debug-iphoneos/MyLibrary.build/Objects-normal/armv7/libMyLibrary.a normal armv7

    cd /Users/Bob/Projects/MyLibrary

    setenv IPHONEOS_DEPLOYMENT_TARGET 6.0

    setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin"

    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static -arch_only armv7 -syslibroot /Users/Bob/Projects/Xcode\ SDKs/iPhoneOS6.1.sdk -L/Users/Bob/Library/Developer/Xcode/DerivedData/MyLibrary-fxukfghqxapkcqcnjjhmhecxahhg/Build/Products/Debug-iphoneos -filelist /Users/Bob/Library/Developer/Xcode/DerivedData/MyLibrary-fxukfghqxapkcqcnjjhmhecxahhg/Build/Intermediates/MyLibrary.build/Debug-iphoneos/MyLibrary.build/Objects-normal/armv7/MyLibrary.LinkFileList -ObjC -framework SystemConfiguration -framework Security -framework CoreGraphics -framework CoreText -framework CoreLocation -framework UIKit -framework QuartzCore -framework Foundation -lPods -o /Users/Bob/Library/Developer/Xcode/DerivedData/MyLibrary-fxukfghqxapkcqcnjjhmhecxahhg/Build/Intermediates/MyLibrary.build/Debug-iphoneos/MyLibrary.build/Objects-normal/armv7/libMyLibrary.a

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: -dynamic not specified the following flags are invalid: -ObjC

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't locate file for: -lPods

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: -lPods is not an object file (not allowed in a library)

Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool failed with exit code 1

What can I do / what other information should I provide?



My problem was that I went from using a podfile of the format

platform :ios, '6.0'

pod 'AFNetworking'

to

platform :ios, '6.0'

target 'myproject' do

    pod 'AFNetworking'

end

which changed libPods.a to lib-myproject.a. The project file was still trying to link libPoda.a though, which no longer existed and resulted in the error. Delete libPods.a from the link with framework section of the build phases.

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容