1

As the title shows, I'm currently facing a problem in which I'm trying to add a Swift file to my ObjC project. The bridging header is generated and as soon as I'm trying to build, it stops with the error:

<unknown>:0: error: opening import file for module 'Swift': Permission denied

This only happens with 1 specific project (which is an old app that has been receiving updates once every year or so). A newer project can implement the swift file and build without any problems. I've compared the build settings but couldn't find any differences (and the ones that were there, eventually didn't cause the error).

I've attempted to remove all the Swift related data in the app and let it get generated again, which didn't work. I've also tried to build on both iOS8 and 8.1, but to no avail.

I'm currently out of ideas on what can cause it and I haven't been able to find anything on StackOverflow or Google in general about it so far.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Grumpmeister
  • 31
  • 1
  • 6
  • Can you show the code in your bridging header? – Nate Cook Oct 08 '14 at 15:03
  • The bridging header is currently empty since I don't need any ObjC classes in Swift, just the other way around (so a Swift function has to be used by ObjC). In other projects, the bridging header is empty as well, but they manage to build. In none of the testcases, the actual Swift code is called upon by ObjC yet. The file is just imported and I attempt to build the project. – Grumpmeister Oct 08 '14 at 15:08

1 Answers1

1

The only method I've found and eventually have used is by creating a completely new Xcode project and restructuring/importing the old files. I've spent an Apple ticket on this project, but they haven't been able to help me out with this problem either.

So, my answer to this is; Create a new Xcode project if it's too outdated to implement Swift.

Grumpmeister
  • 31
  • 1
  • 6
  • Since at first nothing worked for me (resetting user data, restarting and reinstalling Xcode, setting up the project from scratch, etc...), here's my solution for anyone who still cannot resolve this problem: http://stackoverflow.com/a/30936301/2440410 – Yeehaw Jun 19 '15 at 10:52