Mobile_Developer
Mobile_Developer

Reputation: 69

How to resolve "PCH file not found" error coming in the code?

I just cloned a github code. When i tried to run it , it gave me no bridging header available isse, which i resolved by changing the folder name in "Build settings" . After that when i tried to build i am getting this issue as

"<unknown>:0: error: PCH file '/Users/iosdeveloper/Library/Developer/Xcode/DerivedData/Project-ebqolwjodqhfifemlvpiqcmkwmtt/Build/Intermediates.noindex/PrecompiledHeaders/Project_1CZ4Z98EHTKKG-clang_1PO86BEGEY3JE.pch' not found: module file not found
<unknown>:0: error: clang importer creation failed
"

Please help me on this.

Upvotes: 5

Views: 7911

Answers (3)

MinnuKaAnae
MinnuKaAnae

Reputation: 1646

In my case I've not included .h extension at the end of App-Bridging-Header in Build Settings. After given App-Bridging-Header.h the error gone. Hope it will help to some one.

Upvotes: 8

Max Chuquimia
Max Chuquimia

Reputation: 7854

I too had this issue today - I found that if I gave the path to my App-Bridging-Header.h in the form of "${SRCROOT}/App/Some/Directory/App-Bridging-Header.h" the error in question would occur, however by changing the bridging header path to simply App/Some/Directory/App-Bridging-Header.h the PCH "module file not found" disappeared and I was able to compile my project.

I did not need to create a Prefix.pch file at all

Hope this helps someone!

Upvotes: 1

Shehata Gamal
Shehata Gamal

Reputation: 100533

Use $(SRCROOT)/$(PROJECT_NAME) to setup a dynamic link as dragging the file to settings make a static path and that causes a problem when running the project in another path

go to

1- Build Settings > Search: "Prefix Header".

2- Under "Apple LLVM 7.0" you will get the Prefix Header key.

3- Type file directory. e.g: "$(SRCROOT)/$(PROJECT_NAME)/ProjectName-Prefix.pch".

Upvotes: 3

Related Questions