iosxcodeswiftmodulexcode6.3

Xcode 6.3.1 error: Timed out waiting to acquire lock file for module 'X' where 'X' is my framework


I have the following projects in my workspace:

  1. Common
  2. Security (dependent on Common)
  3. Data (dependent on Common, Security, (and CoreData))
  4. Api (dependent on Common, Security, Data)
  5. MyApp (dependent on Common, Security, Data, Api)

All of the projects except MyApp are Cocoa Touch Frameworks, mostly written in Swift.

Since Xcode 6.3.1 I'm unable to compile as I'm getting the following message while building my 'Api' framework:

<unknown>:0: error: timed out waiting to acquire lock file for module 'Data'
~/Developer/myapp/src/Api/Api/SomeClass.swift:4:8: error: cannot load underlying module for 'Data'
import Data
       ^

Solution

  • As for other issues in Xcode 6.3.1, there seems to be a workaround.

    I have found that compiling the Data.framework target with the following settings solves the issue:

    SWIFT_WHOLE_MODULE_OPTIMIZATION = YES
    

    Although, the compilation takes longer (as Xcode pre-6.3) and I have some troubles using lldb especially in case or printing out NSManagedObject subclasses:

    (lldb) po object
    error: Error in auto-import:
    failed to get module 'NSManagedObjectID' from AST context