0

我是一名初级程序员,在使用可可豆荚时遇到了谷歌分析库的问题。

我已经正确安装了可可豆荚,安装了包含依赖项的 pod 文件。Pods甚至我也可以在单独的文件夹“ ”中看到 finder 中的生成文件,GoogleAnalytics1.xcworkspace但仅供参考

  1. GoogleAnalytics1 是我的项目的名称。

  2. GoogleAnalytics1.xcworkspace(在 pod 文件安装期间创建)和 GoogleAnalytics.xcodeproject 位于名为“GoogleAnalytics1”的同一文件夹中。

任何形式的帮助将不胜感激。在此先感谢。

Ld /Users/rajesh/Library/Developer/Xcode/DerivedData/GoogleAnalytics1-gklncgocdpccldgqeibewkakesqh/Build/Products/Debug-iphonesimulator/GoogleAnalytics1.app/GoogleAnalytics1 normal i386
cd /Users/rajesh/Documents/Mangesh/BBI/Project/US/NewTableView16/GoogleAnalytics1
export IPHONEOS_DEPLOYMENT_TARGET=8.1
export PATH="/Applications/Xcode 2.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode 2.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode\ 2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode\ 2.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk -     
L/Users/rajesh/Library/Developer/Xcode/DerivedData/GoogleAnalytics1-    gklncgocdpccldgqeibewkakesqh/Build/Products/Debug-iphonesimulator -    L/Users/rajesh/Documents/Mangesh/BBI/Project/US/NewTableView16/GoogleAnalytics1/Pods/Google/Libraries -
L/Users/rajesh/Documents/Mangesh/BBI/Project/US/NewTableView16/GoogleAnalytics1/Pods/GoogleAnalytics/Libraries -
L/Users/rajesh/Documents/Mangesh/BBI/Project/US/NewTableView16/GoogleAnalytics1/Pods/GoogleNetworkingUtilities/Libraries -
L/Users/rajesh/Documents/Mangesh/BBI/Project/US/NewTableView16/GoogleAnalytics1/Pods/GoogleSymbolUtilities/Libraries -
L/Users/rajesh/Documents/Mangesh/BBI/Project/US/NewTableView16/GoogleAnalytics1/Pods/GoogleUtilities/Libraries -
F/Users/rajesh/Library/Developer/Xcode/DerivedData/GoogleAnalytics1-gklncgocdpccldgqeibewkakesqh/Build/Products/Debug-iphonesimulator -filelist   /Users/rajesh/Library/Developer/Xcode/DerivedData/GoogleAnalytics1-  
gklncgocdpccldgqeibewkakesqh/Build/Intermediates/GoogleAnalytics1.build/Debug-iphonesimulator/GoogleAnalytics1.build/Objects-normal/i386/GoogleAnalytics1.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -objc_abi_version -Xlinker 2 -ObjC -lGGLAnalytics -lGGLCore -lGSDK_Overload -lGTMSessionFetcher_core -lGTMSessionFetcher_full -lGTMStackTrace -lGTM_AddressBook -lGTM_DebugUtils -lGTM_GTMURLBuilder -lGTM_KVO -lGTM_NSDictionary+URLArguments -lGTM_NSScannerJSON -lGTM_NSStringHTML -lGTM_NSStringXML -lGTM_Regex -lGTM_RoundedRectPath -lGTM_StringEncoding -lGTM_SystemVersion -lGTM_UIFont+LineHeight -lGTM_core -lGTM_iPhone -lGoogleAnalytics -lsqlite3 -lz -framework AddressBook -framework CoreData -framework SystemConfiguration -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=8.1 -lPods-GoogleAnalytics1 -Xlinker -dependency_info -Xlinker /Users/rajesh/Library/Developer/Xcode/DerivedData/GoogleAnalytics1-gklncgocdpccldgqeibewkakesqh/Build/Intermediates/GoogleAnalytics1.build/Debug-iphonesimulator/GoogleAnalytics1.build/Objects-normal/i386/GoogleAnalytics1_dependency_info.dat -o /Users/rajesh/Library/Developer/Xcode/DerivedData/GoogleAnalytics1-gklncgocdpccldgqeibewkakesqh/Build/Products/Debug-iphonesimulator/GoogleAnalytics1.app/GoogleAnalytics1

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

1 回答 1

0

如评论中所述,您需要打开 .xcworkspace 文件才能打开项目,一旦您有 pod 对其进行操作。

我遇到的另一个问题 - XCode 7(目前仍处于 Beta 版,但很快就会正常发布)也会在 cocoapods 上产生这些问题。因此,如果您现在尝试使用 Swift 2,cocoapods 无法在项目中工作,并且您会遇到与您所看到的错误类似的错误。由于这个问题,我不得不在当前的 Swift 2 项目中卸载 cocoapods,而我目前正在寻找其他选项 - Carthage 看起来是迄今为止最好的选择。 https://github.com/Carthage/Carthage

于 2015-09-04T11:46:50.110 回答