2

I am working on an iOS project which was using AFNetworking v1.3.1 without an issue. Recently, we decided not to support iOS 5.0 any more and updated the project to support iOS 6.0 and also pod versions accordingly. I have migrated the project to AFNetworking v2.3.1 and it works like a charm when running the project both on device and simulator. Yet it fails when trying to run Kiwi tests. It gives the error:

'AFNetworking.h' file not found

Do not get me wrong, I have searched SO and AFNetworking's issues page but all I can find is changing the Header Search Paths would fix similar issues yet not mine. Xcode cannot even find anything related to AFNetworking when test build.

This is my pod file:

platform :ios, '6.0'
pod 'Kiwi/XCTest', '2.2.4'
pod 'AFNetworking', '2.3.1'
pod 'MBProgressHUD', '~> 0.8'
pod 'FMDB'
pod 'JSONModel'

This is Header Search Paths for product target and tests target respectively:

"${PODS_ROOT}/Headers"
"${PODS_ROOT}/Headers/AFNetworking"
"${PODS_ROOT}/Headers/FMDB"
"${PODS_ROOT}/Headers/JSONModel"
"${PODS_ROOT}/Headers/Kiwi"
"${PODS_ROOT}/Headers/MBProgressHUD"
#
$(inherited)
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
"${PODS_ROOT}/Headers"
"${PODS_ROOT}/Headers/AFNetworking"
"${PODS_ROOT}/Headers/FMDB"
"${PODS_ROOT}/Headers/JSONModel"
"${PODS_ROOT}/Headers/Kiwi"
"${PODS_ROOT}/Headers/MBProgressHUD"

I might be looking at the wrong direction, so if you could point me to right one it would be much appreciated.

sercancici
  • 77
  • 1
  • 12
  • Does the Kiwi test target have the new AFNetworking as a dependency? – mttrb Aug 09 '14 at 09:13
  • It was not. I have added it yet no luck. I cannot understand that people say that AFNetworking.h is not included in 2.x yet I have this header file and it works on production environment, just not on test environment. – sercancici Aug 09 '14 at 09:21
  • Just inserted `link_with` to my pod file as suggested in an SO answer but it did not seem to change anything. – sercancici Aug 09 '14 at 09:45
  • @sercancici did you figure this out?? – cph2117 Oct 09 '14 at 01:15
  • 1
    Yes I've sorted it out and I still do not have any idea why. The `import` statement was in .h file (I do not remember which class) when I moved it to .m it just magically started working. Hope it helps. – sercancici Oct 13 '14 at 07:59

0 Answers0