【问题标题】:Cocoapods - can't locate file for: -lPods / -lPods is not an object file (not allowed in a library)Cocoapods - 找不到文件:-lPods / -lPods 不是目标文件(库中不允许)
【发布时间】:2014-04-15 17:39:07
【问题描述】:

我有一个尚未构建的 iOS 静态库。它使用 cocoapods 来管理许多依赖项以及作为 pod 本身。

有趣的是,当该库在客户端项目中用作 pod 时,一切都可以正常编译。

这是我的错误的输出:

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

我能做什么/我应该提供哪些其他信息?

【问题讨论】:

    标签: ios static-libraries static-linking cocoapods


    【解决方案1】:

    我的问题是我从使用格式的 podfile 开始

    platform :ios, '6.0'
    pod 'AFNetworking'
    

    platform :ios, '6.0'
    target 'myproject' do
        pod 'AFNetworking'
    end
    

    将 libPods.a 更改为 lib-myproject.a。项目文件仍在尝试链接 libPoda.a,但该文件已不存在并导致错误。从构建阶段的框架部分的链接中删除 libPods.a。

    【讨论】:

    • 我想你的意思是说它现在是 libPods-mytarget.a... 假设你的 Podfile 中有 target 'mytarget' do(有 target 'myproject' 会掩盖 xcode 项目和目标之间的区别)。跨度>
    【解决方案2】:

    在谷歌项目上查看这个答案:https://groups.google.com/forum/?fromgroups=#!topic/cocoapods/DOVaKHXzfnI

    基本上,我认为您应该在build phasestarget dependencies 中正确链接两个库和mb。如果您提供有关您当前配置的更多信息,我可以说得更准确。

    【讨论】:

      猜你喜欢
      • 2015-12-22
      • 2014-07-27
      • 1970-01-01
      • 2015-08-16
      • 2016-09-16
      • 2015-01-23
      • 1970-01-01
      • 2018-03-28
      • 2014-06-25
      相关资源
      最近更新 更多