'torch/csrc/jit/mobile/import.h' file not found

I tried to copy and paste the inference module from ios-demo-app/SpeechRecognition at master · pytorch/ios-demo-app · GitHub into my own xcode project

I always get the error in LibTorch-Lite.h saying ‘torch/csrc/jit/mobile/import.h’ file not found.

I tried pod ‘LibTorch_Lite’, ‘~>1.9.0’ and pod ‘LibTorch_Lite’, ‘~>1.10.0’ and tried both #import <Libtorch-Lite.h> and #import <Libtorch-Lite/Libtorch-Lite.h> but nothing worked. I didn’t find a solution to this issue through Google. Any help would be appreciated!

I found at this issue appears whenever I put InferenceModule.h and InferenceModule.m into my pods folder and it might have to do with header search path. Any idea why it’s happening?