Cocoa Pods在调试模式下运行时无法链接库?

时间:2014-11-28 12:22:45

标签: ios objective-c xcode cocoapods

我正在使用pods来链接AfNetworkingfacebook等库,并且它在release模式下运行良好,但我想通过调试检查变量值但是它显示释放模式中的所有变量nil。我尝试通过编辑模式以debug模式运行,但无法编译显示找不到各种库错误。

编辑我尝试更新架构.....但这并没有帮助。 调试模式下的错误日志

ld: warning: directory not found for option '-L/Users/madept/Desktop/personally/Pods/build/Debug-iphoneos'
ld: warning: ignoring file /Users/madept/Desktop/personally/libCloudinary.a, missing required architecture x86_64 in file /Users/madept/Desktop/personally/libCloudinary.a (3 slices)
Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_AFHTTPRequestOperation", referenced from:
      objc-class-ref in ZRAPIClient.o
  "_OBJC_CLASS_$_AFHTTPRequestSerializer", referenced from:
      objc-class-ref in ZRAPIClient.o
  "_OBJC_CLASS_$_AFJSONResponseSerializer", referenced from:
      objc-class-ref in ZRAPIClient.o
  "_OBJC_CLASS_$_BITHockeyManager", referenced from:
      objc-class-ref in ZRAppDelegate.o
  "_OBJC_CLASS_$_CLCloudinary", referenced from:
      objc-class-ref in ZRMediaManager.o
  "_OBJC_CLASS_$_CLTransformation", referenced from:
      objc-class-ref in ZRMediaManager.o
  "_OBJC_CLASS_$_DDFileLogger", referenced from:
      objc-class-ref in Zooplr.o
  "_OBJC_CLASS_$_DDLog", referenced from:
      objc-class-ref in Chat.o
      objc-class-ref in ZRManagedObject.o
      objc-class-ref in ZRTelescopingScrollView.o
      objc-class-ref in ZRAddMessageBarController.o
      objc-class-ref in ZRCreateAccountViewController.o
      objc-class-ref in ZRAddressBookHelper.o
      objc-class-ref in Zooplr.o
      ...
  "_OBJC_CLASS_$_DDTTYLogger", referenced from:
      objc-class-ref in Zooplr.o
  "_OBJC_CLASS_$_ELCAlbumPickerController", referenced from:
      objc-class-ref in ZRMediaCaptureController.o
  "_OBJC_CLASS_$_ELCImagePickerController", referenced from:
      objc-class-ref in ZRMediaCaptureController.o
  "_OBJC_CLASS_$_EZAudioPlotGL", referenced from:
      objc-class-ref in ZRMediaCaptureController.o
  "_OBJC_CLASS_$_EZMicrophone", referenced from:
      objc-class-ref in ZRMediaCaptureController.o
  "_OBJC_CLASS_$_EZRecorder", referenced from:
      objc-class-ref in ZRMediaCaptureController.o
  "_OBJC_CLASS_$_FBAppCall", referenced from:
      objc-class-ref in ZRAppDelegate.o
  "_OBJC_CLASS_$_FBErrorUtility", referenced from:
      objc-class-ref in ZRSocialClient.o
  "_OBJC_CLASS_$_FBRequest", referenced from:
      objc-class-ref in ZRSocialClient.o
  "_OBJC_CLASS_$_FBRequestConnection", referenced from:
      objc-class-ref in ZRSocialClient.o
  "_OBJC_CLASS_$_FBSession", referenced from:
      objc-class-ref in ZRAppDelegate.o
      objc-class-ref in ZRSocialClient.o
  "_OBJC_CLASS_$_Mixpanel", referenced from:
      objc-class-ref in ZRAnalyticsTracker.o
      objc-class-ref in Zooplr.o
  "_OBJC_CLASS_$_Reachability", referenced from:
      objc-class-ref in Zooplr.o
  "_OBJC_CLASS_$_SSKeychain", referenced from:
      objc-class-ref in ZRAuthManager.o
  "_OBJC_CLASS_$_SVProgressHUD", referenced from:
      objc-class-ref in ZRAccountEditViewController.o
      objc-class-ref in ZRAppDelegate.o
  "_OBJC_CLASS_$_SocketIO", referenced from:
      objc-class-ref in ZRChatSocketClient.o
  "_OBJC_CLASS_$_TTTAttributedLabel", referenced from:
      objc-class-ref in ZRBubbleViewTextMessage.o
  "_kReachabilityChangedNotification", referenced from:
      -[ZRAppDelegate application:didFinishLaunchingWithOptions:] in ZRAppDelegate.o
      -[ZRChatSocketClient init] in ZRChatSocketClient.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

任何帮助或建议都将不胜感激。

5 个答案:

答案 0 :(得分:8)

如果上述答案对您不起作用,可能问题来自您安装播客时的问题。运行pod install

时,请检查您是否收到此类消息
  

ProjectName [Release]目标覆盖`Pods / Target Support Files / ProjectName / Pods-ProjectName.release.xcconfig'中定义的OTHER_LDFLAGS构建设置。这可能会导致CocoaPods安装出现问题

或类似的消息,但debug而不是发布(或两者)。 如果是这样,请在Xcode中删除工作区中的pod项目,然后按照此问题的答案The target ... overrides the `OTHER_LDFLAGS` build setting defined in `Pods/Pods.xcconfig,我在此处将其删除:

  

这绝对适用于大部分时间:

     

转到目标构建设置 - >其他链接器标志 - >双击。将$(继承)添加到新行。

然后再次运行pod install。它是为我做的。

答案 1 :(得分:7)

这意味着您使用的静态库不支持x86_64体系结构,
所以

  1. 打开“Pods”目标的“Build Settings”,并添加“x86_64”架构(在“架构”和“有效架构”部分中)。
  2. 将“仅构建活动架构”设置为“否”。
  3. 清理“豆荚”目标。
  4. 建立你的目标。

答案 2 :(得分:2)

删除/ Users / YourName / Library / Developer / Xcode / DerivedData / YourProject / Build / Products / Debug-iphoneos中的.a文件。然后清理和建造。这对我有帮助。

答案 3 :(得分:1)

对我有用的是将$(继承)添加到:

  • OTHER_LDFLAGS
  • OTHER_CFLAGS
  • FRAMEWORK_SEARCH_PATHS
  • GCC_PREPROCESSOR_DEFINITIONS

提示:内部构建设置 - > (搜索栏) - >输入上面的选项并添加$(继承)

答案 4 :(得分:0)

我删除了.a文件,它不会对我有用,但当我删除/ Users / YourName / Library / Developer / Xcode / DerivedData / YourProject中的项目文件夹时。 这对我有帮助。