I am facing build fail error after moving Bridging-Header objective-c swift on xcode6. Before I moved header file, it had been working fine. The error shows header file not exist. The header file path remains still old path in error log. I tried build clean, but still old path remains. How can clean the objc-header-path?
6 Answers
You need to update the path in your project's Build Settings to point to the new bridging header location.
Click your target and then click 'Build Settings' then search for Objective-C Bridging Header

- 3,966
- 1
- 20
- 17
-
I tried to clear and rewrite but error log shows and points old path. – tajihiro Sep 07 '14 at 22:37
-
Try also clearing all your derived data and also restarting your machine. I've had a lot of issues with the beta and sometimes those 2 things have helped. http://stackoverflow.com/questions/18933321/deleting-contents-from-xcode-derived-data-folder – Austen Chongpison Sep 07 '14 at 23:00
-
Once you find it, you have to double click it to edit. It looks unusual at that point - it pops down a window with the path in it. But you can edit it there. Do the change for both Debug and Release. I found this error happens when duplicating a file. You will also have to change the path for the Info.plist. Then it works. – TM Lynch Oct 09 '19 at 16:27
You'll find the path to the bridging header in your target's Build Settings, under "Swift Compiler - Code Generation"/"Objective C Bridging Header".

- 37,886
- 9
- 99
- 128
-
Yes, I rewrite the new path that setting of your advice. I clear and clear and build again. But still old path remains error log. And restart Xcode as well. still shows the same old path in error. – tajihiro Sep 07 '14 at 22:32
I tried with Xcode6.1-Beta, as well. But still impossible to update the objective-c header path. I don't know where the configuration file is. I gave up to figure out.
Finally, I deleted the target xcode project and recreated new project. Now it is working.

- 2,293
- 7
- 39
- 60
Yes it's possible.
- Delete the .h file
- Clear the path at Objective-C Bridging Header
- Create new Objective-C File
- Name your header file to the same name as before (popup will ask you to create new header file)
- Goto File > Project Settings > Data Location
- Make sure your path is correct and press "Done"
Your app should run again pointing to the right location of the header file and delete the files ModuleCache
Happens to me many times when i move app folder around.

- 2,886
- 4
- 24
- 37

- 1
I had a workspace that I was using when I had the same thing happen. I moved my project to a different folder. Despite having a relative path on my bridge headers, it was still referencing the old location when building and threw an error.
Here's what I did to fix this:
Close the workspace
Open the .xcworkspace file using TextWrangler. TextWrangler allowed me to navigate the package to /xcuserdata/[username].xcuserdatad/UserInterfaceState.xcuserstate. I did a search for the old path and found it. Make the change to the new location of the header file.
This by itself didn't fix it. After cleaning and building, the old value showed back up! Then I deleted the Build folder. It has a ModuleCache that I think was holding on to the old value as well.
After doing this, my project picked up my new value and I was able to build the project. I'm not certain step 2 is necessary. But it did store the old value in there.

- 93
- 1
- 6
In my case, I changed the path from relative path to absolute path and solved.
like
From: project_name/project_name-Bridging-Header.h
To: $(SRCROOT)/project_name/project_name-Bridging-Header.h

- 844
- 1
- 11
- 23