6 Replies
      Latest reply on Aug 14, 2019 6:20 PM by bstahl
      Zaba Level 1 Level 1 (0 points)

        Hi,

        I've a issue with integrating swift packages into projects that were created via e.g. xcode 10 (pre 11).

        I see added library in 'Swift Package Dependencies' correctly, it's in 'Frameworks, Libraries and Embedded Content' section of target's settings as well as in 'Link Binary With Libraries' section of 'Build Phases'

         

        If I create a new project then everything works smothly. A few things that I've already tried:

        - Copy swift package manualy (by drag and drop) into the project

        - Add package via file://LocalURL

        - I've compared info.plist, build settings and schemes beteen old and new project (Maybe I've missed something, my guess is that the issue is in build settings but I can't find it)

         

        The result is always the same, if I import SPM library in any file I get an error "No such module 'ExampleFramework'"

         

        Any ideas? Thanks in advance for any help

        • Re: SPM in project pre Xcode 11 - 'No Such Module'
          Claude31 Level 8 Level 8 (6,355 points)

          Sorry if that's a trivial question.

           

          Did you do an option-clean build Folder from XCode project menu ?

          • Re: SPM in project pre Xcode 11 - 'No Such Module'
            Zaba Level 1 Level 1 (0 points)

            Ok so after various tries I've created new project, added files from the old one and during this I've encountered at identical situation, it turns out that the issue is not in build settings but rather in configuration.

            You cannot build SPM with different configuration than 'Debug' and as in most of my projects I have multiple configurations, that why I wasn't able to use SPM in them.

            Unfortunately I couldn't find a way to change target configuration, nevertheless I'm closing this thread, I hope that my explanation above will hope someone with the same issue

            • Re: SPM in project pre Xcode 11 - 'No Such Module'
              bstahl Level 1 Level 1 (0 points)

              I'm having the same or a similar problem, but in my case re-creating the project and workspace files in Xcode 11 beta-5 still results in those "no such module" errors when compiling/linking my SPM dependencies. In addition to "no such module" errors, some dependencies generate "Command CompileSwift failed with nonzero exit code" errors. Like you, I can run it fine in Debug mode, but cannot export using Archive. This seems like a bug (I hope?), hopefully one that will be fixed soon. This project was fine compiling non-Debug builds in Xcode 10.X. I'm using macOS 10.14.4, but I also tried it in macOS 10.15 beta-5, but it didn't fix anything.

               

              Submitted Feedback Assistant bug report #FB7031121 "Xcode 11 beta-5 with SPM dependencies produces errors with Archive build."