Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Opening import file for module 'Swift': Not a directory

Tags:

swift

libxml2

After following the instructions here to setup libxml on Swift: libxml/tree.h no such file or directory

I encountered an error while compiling which said:

Opening import file for module 'Swift': Not a directory

I've searched online and they recommending cleaning the project which didn't work for me. Any idea what's causing this error?

like image 205
YellowPillow Avatar asked Feb 02 '15 05:02

YellowPillow


2 Answers

I got this error when I had an invalid path to a framework in my Framework Search Path and User Header Search Paths. I simply fixed the path by adding ".framework" to the end of the path, to make the path valid, and this error went away.

like image 108
spfursich Avatar answered Oct 01 '22 22:10

spfursich


Issue cropped up after adding my first swift class to the project.

I fixed it by going into the build settings for ALL targets (including the actual project) and remove any erroneous paths from Framework Search Path.

Specifically:

  1. Simplified the main target to:

    $(inherited)

    $(SRCROOT)

  2. And by removing an old, erroneous path to libxml2 on the project.

like image 22
capikaw Avatar answered Oct 02 '22 00:10

capikaw