Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 10 Failed to emit precompiled header for bridging header

Hi I'm getting a very annoying error on Xcode 10 that is

1 error generated. <unknown>:0: error: failed to emit precompiled header '/Users/me/Library/Developer/Xcode/DerivedData/APP-hlczpckeselwrtaqjcbxdpoiogkj/Build/Intermediates.noindex/PrecompiledHeaders/APP-Bridging-Header-swift_35K3KO8G70VCD-clang_3DGF15CYP79L0.pch' for bridging header '/Users/me/Desktop/Swift/Folder/APP/APP/UNLKV2-Bridging-Header.h'

I'm not sure how to solve this I have tried everything. It was very sudden today before there was no problem but the second I added the Firebase info.plist to the project I got this error. I have tried to delete the file, made sure the name of the header file was entered correctly in the "Objective-C Bridging Header" and I have it entered as
$(PROJECT_DIR)/$(PROJECT_NAME)/$(PROJECT_NAME)-Bridging-Header.h
I have cleaned and built the project multiple times and reinstalled all the pods.

Besides this, I also get an error that

JPSVolumeButtonHandler/JPSVolumeButtonHandler.h' file not found

I would really appreciate it if someone could help me solve this, I've been looking around all day at every single post and forum and nothing has worked for me. If you need any more information about this issue, please let me know.

like image 406
Jaqueline Avatar asked Sep 23 '18 05:09

Jaqueline


2 Answers

Had same issue that I've tried to fix for hours. Ended up with this solution:

  1. select scheme, from appeared menu choose Manage Schemes...
  2. from popped up list of schemes find [Your Project Name] scheme, select it and delete by pressing - button in the bottom left corner of list
  3. Press Autocreate Schemes Now button in the top right corner

See screenshots below:

enter image description here

enter image description here

like image 126
Oleg Poliukhovych Avatar answered Oct 02 '22 11:10

Oleg Poliukhovych


I'm currently facing the exact same problem (with other pod headers missing) ; tried to delete all pod folder, clear cache install again, update pods... nothing works.

Also tried to do as told in xconfig file : FRAMEWORK_SEARCH_PATHS = $(inherited) $(PROJECT_DIR) "$(SRCROOT)" "$(SRCROOT)/Framework", but still blocked.

This bridging-header error happens when using the "legacy build system", since the new build system given w/ Xcode10 brings many more issues for older projects. Dunno if this is relevant but joining here current build phases of my target.

Edit : Eventually I found what my problem was, it may be the same for some.

In the workspace settings I changed the build system to the Legacy one. However, I also thought it was a good idea to change the Build Location to Legacy ; That was what caused my issue.

How I fixed :

a) in the Workspace Settings, let build system on 'Legacy build system'

b) click on Advanced, then change build location to Xcode Default

c) then my build would still fail because of the outdated library libstdc++ ; so i changed it with the libc++ library in my 'common.xconfig' file : CLANG_CXX_LIBRARY = libc++.

Everything works fine for me now. Hope this helps others.

like image 32
Yolobob Avatar answered Oct 02 '22 11:10

Yolobob