Ios – Opening import file for module ‘Swift’ Permission denied


I'm a newbie at working in Xcode and swift.
I was working on a iOS project on my macbook (while on holiday), and i've been using github version control, i've now returned to home and now working on my mac mini.
Currently working in Xcode 6.3.1 and the target is for iOS 8.3

So i've cloned my project on the mac mini, and when opening and trying to build the project i get the error:

Opening import file for module 'Swift': Permission denied

I'm looking at the errors and it seems to be 4 issues, my AppDelegate.swift, and 3 ViewController.swift files (i only have 3 of these at the moment)

I've had a look at another question on here – Opening import file for module 'Swift': Permission denied but it's not relevant to my issue.

A couple things i noticed were

  1. some of my frameworks i.e. parse and bolts were highlighted in red,
    i pointed them to the location of these on my mac mini (not sure if
    that was the correct thing to do), but they aren't highlighted
  2. Under the products folder, my .app and .xctest files are highlighted
    red. Not sure how to fix that

Has anyone encountered this before? I would really appreciate the help from you guys.


Best Solution

In our case, the error was that some of the frameworks were built with XCode 7.1 on OSX 10.10, then the binaries where uploaded to a dependency manager (Carthage).

The failing project was compiled with XCode 7.1 on OSX 10.11 and it was pulling those frameworks from Carthage.

Apparently the mismatch in OSX versions was causing problems. Once all frameworks were recompiled on OSX 10.11, it stopped failing.

Note that sometimes it failed with a permission denied on one of our frameworks, sometimes with a permission denied on CoreData. Replacing the frameworks binaries with binaries built with 10.11 fixed the issue. On a side note, frameworks built with 10.11 seem to work fine on 10.10.