'MyHeader.h file not found' when building Project with embedded Framework Project

1.1k views Asked by At

When building an app project with an embedded framework project as a dependency, I added a protocol and builds got errors for

MyProtocol.h file not found

Where could the error be?

2

There are 2 answers

1
uchuugaka On BEST ANSWER

I looked at circular #import dependencies and that was not it. I tried forward declaring the protocol wherever possible. That was not it.

It turns out the gotcha was simply going back to the embedded project Build Phases and making sure to copy the header.

This would apply to any additional class or other header file added.

It is easy to forget this while working on a framework (or other embedded project) inside a project. You can edit and compile changes to existing files, but adding new headers must be copied in Build Phases or they cannot be found.

Spent 30 minutes of my life on this. Hope it helps somebody.

0
Andrew Khomenok On

This could be also caused by missing 'Header Search Paths' in parent project's Build Settings. Make sure that it points to the folder with your header files.