tajihiro
tajihiro

Reputation: 2443

Xcode 6 beta build fails after moving -Bridging-Header objective-c swift xcode6

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?

Upvotes: 5

Views: 4773

Answers (6)

Ko Ohhashi
Ko Ohhashi

Reputation: 924

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

Upvotes: 0

Barger27
Barger27

Reputation: 93

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:

  1. Close the workspace

  2. 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.

  3. 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.

Upvotes: 0

77wtony
77wtony

Reputation: 1

Yes it's possible.

  1. Delete the .h file
  2. Clear the path at Objective-C Bridging Header
  3. Create new Objective-C File
  4. Name your header file to the same name as before (popup will ask you to create new header file)
  5. Goto File > Project Settings > Data Location
  6. 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.

Upvotes: 0

tajihiro
tajihiro

Reputation: 2443

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.

Upvotes: 1

Austen Chongpison
Austen Chongpison

Reputation: 3974

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

enter image description here

Upvotes: 9

Matt Gibson
Matt Gibson

Reputation: 38238

You'll find the path to the bridging header in your target's Build Settings, under "Swift Compiler - Code Generation"/"Objective C Bridging Header".

Upvotes: 3

Related Questions