Opening an import file for the Swift module: not a directory

After following the instructions for installing libxml in Swift: libxml / tree.h there is no such file or directory

During compilation, I found an error:

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

I searched on the Internet and they recommend cleaning up a project that does not work for me. Any idea what causes this error?

+7
swift libxml2
source share
2 answers

I got this error when I had the wrong structure path in my Framework Search Path and User Header Search Paths . I simply set the path by adding ".framework" at the end of the path to make the path valid, and this error went away.

+2
source share

The problem arose after adding my first class quick project to the project.

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

In particular:

  • Simplified main goal:

    $(inherited)

    $(SRCROOT)

  • And deleting the old, erroneous path to libxml2 in the project.

+1
source share

All Articles