LoginSignup
4
4

More than 5 years have passed since last update.

Kiwi + AFNetworking で Undefined symbols for architecture エラーが出た場合の対処

Posted at

Kiwi については以下のインストール手順通り。

で、AFNetworking を使うので Podfile を以下のように変更。

platform :ios, '5.1'

pod 'AFNetworking', '1.1.0'

target :NSRemoteJsonObjectTests, :exclusive => true do
   pod 'Kiwi'
end

Test 時に以下のエラーが。

Undefined symbols for architecture i386:
  "_SCNetworkReachabilityCreateWithName", referenced from:
      -[AFHTTPClient startMonitoringNetworkReachability] in libNSRemoteJsonObject.a(AFHTTPClient.o)
  "_SCNetworkReachabilityGetFlags", referenced from:
      -[AFHTTPClient startMonitoringNetworkReachability] in libNSRemoteJsonObject.a(AFHTTPClient.o)
  "_SCNetworkReachabilityScheduleWithRunLoop", referenced from:
      -[AFHTTPClient startMonitoringNetworkReachability] in libNSRemoteJsonObject.a(AFHTTPClient.o)
  "_SCNetworkReachabilitySetCallback", referenced from:
      -[AFHTTPClient startMonitoringNetworkReachability] in libNSRemoteJsonObject.a(AFHTTPClient.o)
  "_SCNetworkReachabilityUnscheduleFromRunLoop", referenced from:
      -[AFHTTPClient stopMonitoringNetworkReachability] in libNSRemoteJsonObject.a(AFHTTPClient.o)
  "_UTTypeCopyPreferredTagWithClass", referenced from:
      _AFContentTypeForPathExtension in libNSRemoteJsonObject.a(AFHTTPClient.o)
  "_UTTypeCreatePreferredIdentifierForTag", referenced from:
      _AFContentTypeForPathExtension in libNSRemoteJsonObject.a(AFHTTPClient.o)
  "_kUTTagClassFilenameExtension", referenced from:
      _AFContentTypeForPathExtension in libNSRemoteJsonObject.a(AFHTTPClient.o)
  "_kUTTagClassMIMEType", referenced from:
      _AFContentTypeForPathExtension in libNSRemoteJsonObject.a(AFHTTPClient.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

解決策としては、Test 用のターゲットの Build Phases -> Link Binary With Libraries に、MobileCoreServices.framework と SystemConfiguration.framework を追加することでエラーが回避できました。

4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4