使用CocoaPods使用Xcode 5编译protobuf

时间:2014-04-16 21:23:16

标签: xcode cocoapods protocol-buffers

我正在尝试将GoogleProtobuf(2.5.0)添加到我的应用程序中。根据我的阅读,最好的方法是使用CocoaPods。所以我通过了一个关于CocoaPods入门的教程。我一直到我在项目文件夹中运行pod install的地方,它创建了项目工作区。我打开项目工作区并尝试清理/构建,我收到以下错误:

enter image description here

我是个新手。这对任何人都意味着什么?

哇!这是一张小图片。

让我看看我是否可以复制信息:

Resolving target dependencies
Pods was rejected as an implicit dependency for 'libPods.a' because its architectures 'arm64' didn't contain all required architectures 'armv7'
Write auxiliary files

Ld /Users/pdl/Library/Developer/Xcode/DerivedData/Demo-ggwchkzudvcbibdmaknlspphbkbr/Build/Products/Debug-iphoneos/Demo.app/Demo normal armv7
    cd "/Users/pdl/Development/Application-Demos/iPhone_Demos/Demo"
    export IPHONEOS_DEPLOYMENT_TARGET=7.0
    export 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"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk -L/Users/pdl/Library/Developer/Xcode/DerivedData/Demo-ggwchkzudvcbibdmaknlspphbkbr/Build/Products/Debug-iphoneos -L/Library/FlurryAnalytics/Flurry_iPhone_SDK_viPhone_4/Flurry-iOS-4.3.1/Flurry -F/Users/pdl/Library/Developer/Xcode/DerivedData/Demo-ggwchkzudvcbibdmaknlspphbkbr/Build/Products/Debug-iphoneos -F/Library/OpenCV -F/Users/pdl/Library/Developer/Xcode/DerivedData/QlmMobileDeviceSample-cuzqlikbteeedbeaonfqofugyyql/Build/Products/Release-iphoneos -F/Users/pdl/Library/Developer/Xcode/DerivedData/Dummy-iOS-gumpxuupcpajbvamflgypgfwjshp/Build/Products/Release-iphoneuniversal -filelist /Users/pdl/Library/Developer/Xcode/DerivedData/Demo-ggwchkzudvcbibdmaknlspphbkbr/Build/Intermediates/Demo.build/Debug-iphoneos/Demo.build/Objects-normal/armv7/Demo.LinkFileList -dead_strip -ObjC -lstdc++ -fobjc-arc -fobjc-link-runtime -miphoneos-version-min=7.0 -framework Dummy-iOS-1.1.0 -lFlurry_4.3.1 -framework QlmLicenseMobile -lc++ -framework opencv2 -framework AdSupport -lz -lxml2.2 -framework Security -framework SystemConfiguration -framework AssetsLibrary -framework CoreGraphics -framework UIKit -framework Foundation -lPods -Xlinker -dependency_info -Xlinker /Users/pdl/Library/Developer/Xcode/DerivedData/Demo-ggwchkzudvcbibdmaknlspphbkbr/Build/Intermediates/Demo.build/Debug-iphoneos/Demo.build/Objects-normal/armv7/Demo_dependency_info.dat -o /Users/pdl/Library/Developer/Xcode/DerivedData/Demo-ggwchkzudvcbibdmaknlspphbkbr/Build/Products/Debug-iphoneos/Demo.app/Demo

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

我的Podfile包含:

platform :ios, '7.0'
pod 'GoogleProtobuf', '~> 2.5.0'

当我运行安装时,这是输出:

pdl-mbp:Demo pdl$ pod install
Analyzing dependencies

CocoaPods 0.32.1 is available.

Downloading dependencies
Installing GoogleProtobuf (2.5.0)
Generating Pods project
Integrating client project

[!] From now on use `Demo.xcworkspace`.
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.

[!] The target `Demo [Debug]` overrides the `OTHER_LDFLAGS` build setting defined in `Pods/Pods.xcconfig'.
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.

[!] The target `Demo [Debug - Release]` overrides the `OTHER_LDFLAGS` build setting defined in `Pods/Pods.xcconfig'.
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.

[!] The target `Demo [Debug - Release - Ad Hoc Distribution]` overrides the `OTHER_LDFLAGS` build setting defined in `Pods/Pods.xcconfig'.
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.
pdl-mbp:Demo pdl$ 

2 个答案:

答案 0 :(得分:3)

好的,所以我在上两篇评论中提供的两个链接上找到了很多信息。尤其是{问题this answer

我的问题最终是我的Pods Valid Architectures必须与我项目中的Valid Architectures相同。

我整天都花在这上面,在我发布问题的那一刻,我找到了一个帮助我找出问题的答案。

我希望这有助于其他人! : - )

答案 1 :(得分:1)

检查所有项目库。如果看到任何人丢失(红色),请进行专门更新。或者,您可以进入项目目录,使用命令“ pod update”彻底更新所有库。它解决了我的问题。