繁体   English   中英

使用Xcode 6时,AFNetworking与cocoapods链接错误

[英]AFNetworking with cocoapods link error when using Xcode 6

将项目从Xcode 5迁移到6时出现错误。

Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_AFHTTPRequestOperationManager", referenced from:
      objc-class-ref in QCRoomListControllerViewController.o
      objc-class-ref in libQCBase.a(QCHttpRequestAdapter.o)
      objc-class-ref in libQCBase.a(QCHttpApi.o)
  "_OBJC_CLASS_$_AFHTTPResponseSerializer", referenced from:
      objc-class-ref in QCRoomListControllerViewController.o
  "_OBJC_CLASS_$_AFJSONResponseSerializer", referenced from:
      objc-class-ref in libQCBase.a(QCHttpApi.o)
ld: symbol(s) not found for architecture i386

我选择cocoapods作为程序包管理器,项目结构如下: 在此处输入图片说明

大型项目和BaseLib都在使用某些Pod,同时项目正在使用BaseLib.a。

我已经尝试过将Xcode 5与iOS 7.1 SDK(这是唯一可行的工具),Xcode 6与iOS 7.1 SDK以及Xcode 6与iOS 8.0 SDK组合使用。 我目前的结论是,无论我选择哪个版本的iOS SDK,只要涉及Xcode 6,链接都会失败。

相关设置如下所述。

在项目和BaseLib上都正确设置了xcconfig文件: 在此处输入图片说明

架构设置: 在此处输入图片说明

我的Podfile内容:

#platform :ios, "6.0"
source 'https://github.com/CocoaPods/Specs.git'

workspace 'QiChengWS.xcworkspace'
xcodeproj 'QiChengNew/QiChengNew.xcodeproj'
xcodeproj 'QCBase/QCBase.xcodeproj'


target :QiChengNew do
    pod 'JSONModel'
    pod 'SDWebImage', '~>3.6'
    pod 'AutoNSCoding', '~> 0.1.3'

    platform :ios, '7.0'

    pod 'ProtocolBuffers', '~> 1.9'
    pod 'CocoaAsyncSocket', '~> 7.3'

    pod 'GBInfiniteScrollView', '~> 1.6'
    pod 'GBInfiniteScrollView/PageControl'

    pod 'UMengAnalytics', '~> 3.1.2'

    platform :ios, '7'
    pod 'MWPhotoBrowser', '1.4.0'

    xcodeproj 'QiChengNew/QiChengNew.xcodeproj'
end


target :QCBase do
    platform :ios, '7.0'
    pod "AFNetworking", "~> 2.0"

    pod 'SVPullToRefresh', :head

    pod 'Toast', '~> 2.3'

    xcodeproj 'QCBase/QCBase.xcodeproj'
end

希望您现在已经找到解决方案。 如果不更新到AFNetworking 2.4,可以为我解决

在将“ pod”文件安装到我的项目后,我遇到了这类问题。 我使用下面的代码解决了这个问题。

[!] The `sftest [Debug]` target overrides the `OTHER_LDFLAGS` build setting defined in `Pods/Target Support Files/Pods-sftest/Pods-sftest.debug.xcconfig'. This can lead to problems with the CocoaPods installation

- Use the `$(inherited)` flag, or
- Remove the build settings from the target.

将“其他链接器标志”更改为$(继承),它解决了我的问题。

暂无
暂无

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

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