简体   繁体   English

将CocoaPods与Xcode一起使用时,Apple Mach-O链接器错误

[英]Apple Mach-O Linker Error when using CocoaPods with Xcode

I am trying to add PFAnalytics ( instructions here ). 我正在尝试添加PFAnalytics( 此处的说明 )。 Below is my PodFile. 以下是我的PodFile。 I just hit pod install and tried to compile and run, and I see the errors below: 我只是点击pod install并尝试编译和运行,我看到了以下错误:

pod file : pod file

# Uncomment this line to define a global platform for your project
platform :ios, ‘8.0’

target 'ShitTalk' do
pod ‘Parse’
end

target 'ShitTalkTests' do

end

I tried to add Google Analytics too and I see the same error so I think if I try with ANY library with Cocoapods, it's going to do this. 我也尝试添加Google Analytics(分析),但遇到了同样的错误,因此我认为,如果我尝试使用带有Cocoapods的任何库,都可以做到这一点。

Error: 错误: 在此处输入图片说明

You must use the .xcworkspace file after pod install instead of .xcodeproj file. pod install必须使用 .xcworkspace文件,而不是.xcodeproj文件。

The xcworkspace contains your project and your pods . xcworkspace包含您的projectpods

After that you should be able to run normally. 之后,您应该可以正常运行。

Try these two solutions 尝试这两种解决方案

  1. Remove the library .a file from the ProjectTarget->Build Phase ProjectTarget->Build Phase删除库.a文件

  2. Open the workspace .xcworkspace instead of opening the .xcodeproj 打开工作区.xcworkspace而不是打开.xcodeproj

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM