AFHTTPClient.h File Not Found

10,580

Solution 1

It can be because 'HEADER_SEARCH_PATHS doesn't have proper path to search in your added Pod(AFNetworking).

> Open xcworkspace (as after adding podfile/s it is recommended to open xcworkspace instead xcodeproj) and do the following:

  • In file Pods.xcconfig check HEADER_SEARCH_PATHS (example: ${PODS_HEADERS_SEARCH_PATHS} ) and copy it.
  • Now in 'Build Settings' of your 'app Target' add copied HEADER_SEARCH_PATHS to setting 'Header search path'

Alternative approach (Referred from iOS - Build fails with CocoaPods cannot find header files ):

  • In app target , to "User Header Search Paths" entry add following (including quotes)

    "${PODS_ROOT}/BuildHeaders"
    
  • checking 'recursive'



I hope this will solve this File not found issue.

Solution 2

do you open xcworkspace? or xcodeproj? if you use CocoaPods, you always should work only with xcworkspace.

can you find other pods? try to clean the project and try again.

check whether you've done everything from this list: Creating a project that uses CocoaPods

someone had the same problem recently - can't search header path?. try to check your header search path.

Share:
10,580
Nick ONeill
Author by

Nick ONeill

Updated on June 14, 2022

Comments

  • Nick ONeill
    Nick ONeill about 2 years

    I have no idea why this is happening. I've installed AFNetworking in my project via a Podfile. Here's the current entry:

    pod 'AFNetworking', '~> 1.2'
    

    However when I call:

    #import "AFHTTPClient.h"
    

    at the top of one of my files, it says "'AFHTTPClient.h' file not found". If I open up the Pods directory, AFNetworking is in there along with AFHTTPClient.h. I have no idea what's going on. Any ideas?