首页 文章

Apple Mach-O-Linker错误CocoaPods

提问于
浏览
11

我一直试图让我的应用程序运行起来 . 据我所知,该应用程序错过了Cocoapods作为依赖 . 所以 . 我安装并添加了Cocoapods . 但无论出于何种原因,我仍然会得到同样的错误 . 我是一个没有经验的开发人员试图自学我必须添加 .

Ld /Users/bfarag/Library/Developer/Xcode/DerivedData/Umbrella-cspuzusfqmqgnwdqfhtiyivaqwke/Build/Products/Debug-iphonesimulator/Umbrella.app/Umbrella normal i386 cd“/ Users / bfarag / Desktop / Nerdery / BRAVO.iOS . CodeChallenge“export IPHONEOS_DEPLOYMENT_TARGET = 7.0 export 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/开发人员/平台/ 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加速-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)

Linker Flags

3 回答

  • 21

    打开工作区文件,而不是项目文件 . Cocoapods会在与xcproject文件相同的目录中自动创建xcworkspace文件 .

  • 17

    Xcode开始显示此消息,我尝试了很多东西来解决它 . 对我来说最终的诀窍是删除 ~/Library/Developer/Xcode/DerivedData/ 中的所有内容

  • 4

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

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

    您可能还想尝试将-lPods添加到Other Linker Flags或添加CoreGraphics框架(如果您还没有) .

    祝好运

相关问题