<TargetName-Swift.h> file not found [duplicate]
Asked Answered
B

2

12

I just updated my Xcode to 6.3 and my project which was working fine till xcode 6.2 started giving errors .

Error is <TargetName-Swift.h> file not found ,current path of bridging header is inside subfolder of project ,i.e one level inside .xcodeproj file .

Already tried

  1. Deleting Bridging-Header file and recreating it .

  2. Changing the path under Swift Compiler- Code generation under build settings

  3. Also tried to change header search path ,but I think that was already correct .

  4. Checked for circular reference , but i dont think that can be a problem because it was working fine before updating xcode .

Also somewhere I read it is generated at "$(TARGET_TEMP_DIR)/../$(PROJECT_NAME).build/DerivedSources" at this path , but didnot work for me .

****Edit *** Checked the log files generated it has error like "Opening import file for module 'Swift': Permission denied". Any idea ?? Of course I am super admin in the mac I am using .

Tried degrading Xcode again to 6.2 an everything worked well .

Any help would be great ..!! Thanks .

Baten answered 11/4, 2015 at 21:0 Comment(4)
Are you using swift 1.2? If not, then update swift and checkHypesthesia
Apparently xcode6.3 comes default with swift1.2 ,so i guess that should not be a prob as m using xcode6.3.Baten
Are you opening the .xcproject or the .xcworkspace?Munniks
sometimes loop import will also cause the problem. e.g. swift import objc class in bridge header file, objc class header file import swift.hFluidics
C
2

This is due to build errors. <TargetName-Swift.h> is generated when there are no build errors.

Xcode 6.3 includes swift 1.2 which has some breaking changes compared with earlier swift version (distributed with xcode 6.2).

Conney answered 16/4, 2015 at 9:44 Comment(3)
Hi , Thanks for response,but as I mentioned if I still run the same code in 6.2 it work fine ,so do u think there still can be compilation error ?Baten
swift version in xcode 6.2 is different from swift version in xcode 6.3. So, same swift code which gets compiled in xcode 6.2 won't compile in xcode 6.3Conney
Ohh ok,i will give it a try.Baten
Z
-3
  1. Make sure you have Objective-C Bridging Header set to "TARGET_NAME/Your-Bridging-Header.h";" in the Build Settings
  2. Open Terminal and run next commands:

    cd Project_Folder

    sudo chown -R whoami *

Ziguard answered 14/4, 2015 at 15:53 Comment(1)
Bridging headers expose Obj-C to Swift. This is a Swift to Obj-C issue.Shelves

© 2022 - 2024 — McMap. All rights reserved.