xcode环境:7.3.1
系统版本:10.11.6
项目中通过cocoapods添加下面几个库:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
target ‘Zhuoyue’ do
pod 'AFNetworking'
pod 'MOBFoundation_IDFA'
pod 'SMSSDK'
pod 'SSKeychain'
pod 'IQKeyboardManager'
end
安装pod时,实际安装的库版本如下:
Using AFNetworking (3.1.0)
Using IQKeyboardManager (4.0.5)
Using MOBFoundation_IDFA (2.0.10)
Using SMSSDK (2.0.5)
Using SSKeychain (1.4.1)
然而编辑时报错:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_AFHTTPSessionManager", referenced from:
_OBJC_CLASS_$_HttpClient in HttpClient.o
"_OBJC_CLASS_$_AFSecurityPolicy", referenced from:
objc-class-ref in HttpClient.o
"_OBJC_CLASS_$_SSKeychain", referenced from:
objc-class-ref in UserManager.o
"_OBJC_METACLASS_$_AFHTTPSessionManager", referenced from:
_OBJC_METACLASS_$_HttpClient in HttpClient.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
奇怪的是,真机运行时没有问题,但是模拟器编译时就报错了,请问这个问题该如何解决?
문제가 해결되었습니다.
~/Library/Developer/Xcode/DerivedData. xcode를 닫고 DerivedData 폴더의 모든 내용을 삭제한 다음 프로젝트를 다시 엽니다. clean>build