0 Replies
      Latest reply on Dec 17, 2019 6:16 AM by Aliaksandr Baranouski
      Aliaksandr Baranouski Level 1 Level 1 (0 points)

        I'm facing the issue with distributing compiled swift framework. My framework heavily relies on the libxml2 dynamic library. In order to avoid issues with Swift module compatibility, I've set build flag BUILD_LIBRARY_FOR_DISTRIBUTION = YES.

        So I've used Xcode 11.3 Swift v5.1.3 to build my framework. I've integrated it into the Demo.app project. As being expected Demo.app works fine in Xcode 11.3.

        However, I have another error trying to build Demo.app in Xcode 11.0 Swift 5.1. I've got the error:

        :1:9: note: in file included from :1:
        #import "libxml/HTMLparser.h"
                ^
        /Applications/Xcode_11.0.app/Contents/Developer/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator13.0.sdk/usr/include/libxml2/libxml/HTMLparser.h:15:10: error: 'libxml/xmlversion.h' file not found
        #include 
                 ^
        /Users/alex.b/Documents/Projects/Playground/DemoApp/DemoApp/ThirdParty/testXML.framework/Modules/testXML.swiftmodule/x86_64-apple-tvos-simulator.swiftinterface:6:8: error: could not build Objective-C module 'libxml2'
        import libxml2
               ^
        /Users/alex.b/Documents/Projects/Playground/DemoApp/DemoApp/AppDelegate.swift:11:8: error: failed to load module 'testXML'
        import testXML

        Here is the repo with both framework and app projects.

        I'm using both Xcode version on the same Mac.