【问题标题】:Apple Mach-O-Linker Error CocoaPodsApple Mach-O-Linker 错误 CocoaPods
【发布时间】:2014-12-03 12:15:57
【问题描述】:

我一直在努力让我的应用程序启动并运行。据我所知,该应用程序缺少 Cocoapods 作为依赖项。所以。我安装并添加了 Cocoapods。但无论出于何种原因,我仍然遇到同样的错误。我是一个没有经验的开发人员,我必须补充一点。

Ld /Users/bfarag/Library/Developer/Xcode/DerivedData/Umbrella-cspuzusfqmqgnwdqfhtiyivaqwke/Build/Products/Debug-iphonesimulator/Umbrella.app/Umbrella 普通 i386 cd "/Users/bfarag/Desktop/The Nerdery/BRAVO.iOS.CodeChallenge" 导出 IPHONEOS_DEPLOYMENT_TARGET=7.0 导出 PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin: /usr/sbin:/sbin" /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk -L/Users/bfarag/Library/Developer/Xcode/DerivedData/Umbrella-cspuzusfqmqgnwdqfhtiyivaqwke/Build/Products/Debug-iphonesimulator -F/Users/bfarag/Library/Developer/Xcode/DerivedData/Umbrella-cspuzusfqmqgnwdqfhtiyivaqwke/Build/Products/Debug-iphonesimulator -filelist /Users/bfarag/Library/Developer/Xcode/DerivedData/Umbrella-cspuzusfqmqgnwdqfhtiyivaqwke/Build/Intermediates/Umbrella.build/Debug-iphonesimulator/Umbrella.build/Objects-normal/i386/Umbrella.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -ObjC -lPods-Umbrella-AFNetworking -framework CoreGraphics -framework MobileCoreServices -framework Security -framework SystemConfiguration -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=7.0 -framework Accelerate -framework UIKit -framework Foundation -framework CoreGraphics -lPods -lPods-Umbrella -Xlinker -dependency_info -Xlinker /Users /bfarag/Library/Developer/Xcode/DerivedData/Umbrella-cspuzusfqmqgnwdqfhtiyivaqwke/Build/Intermediates/Umbrella.build/Debug-iphonesimulator/Umbrella.build/Objects-normal/i386/Umbrella_dependency_info.dat -o /Users/bfarag/Library/Developer/Xcode/DerivedData/Umbrella-cspuzusfqmqgnwdqfhtiyivaqwke/Build/Products/Debug-iphonesimulator/Umbrella.app/Umbrella

ld: library not found for -lPods
clang: error: linker command failed with exit code 1 (use -v to see invocation)

【问题讨论】:

    标签: ios objective-c xcode cocoapods mach-o


    【解决方案1】:

    打开工作区文件,而不是项目文件。 Cocoapods 会自动在 xcproject 文件所在的目录下创建一个 xcworkspace 文件。

    【讨论】:

    • 是的,我就是这样打开它的。
    • 可能项目文件被手动编辑和破坏。能否再尝试使用 pod update 命令,这样就可以解决此类引用问题?
    • 我的链接器标志是否正常(查看我帖子顶部的新图片)
    【解决方案2】:

    当您没有正确的框架(可能缺少一个)或链接器标志中没有正确的东西时,通常会发生此错误。

    转到应用程序的主页(在左侧导航栏上单击您的应用程序名称或顶部)-> 构建设置并在链接器标志下,确保您的其他链接器标志中没有任何内容。当我的其他链接器标志中有 -ObjC 时,我遇到了同样的错误。

    您可能还想尝试将 -lPods 添加到您的其他链接器标志或添加 CoreGraphics 框架(如果您还没有)。

    祝你好运

    【讨论】:

    • 一样!谢谢!这个问题有很多未解决的票;很高兴我终于找到了这个。
    • 我相信@dadalar 的答案比这个更正确,它对我有用。
    • 谢谢!我从其他链接器标志中删除了 $(inherited) 并且它有效。真希望在我还有头发的时候找到这个。
    【解决方案3】:

    Xcode 开始显示此消息,我尝试了几乎所有方法来解决它。最后对我有用的是删除~/Library/Developer/Xcode/DerivedData/中的所有内容

    【讨论】:

    • 经典 iOS 开发者
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-06-22
    • 2017-08-26
    • 2016-02-05
    • 2014-11-17
    • 1970-01-01
    • 2012-02-01
    相关资源
    最近更新 更多