I've been trying all morning to get a trivial Swift package (local) working. I'm using macOS 11.2 with Xcode 12.4 on an iMac Pro.
In all cases, I'm left with a compile error of Module 'MyPackage' has no member named 'some symbol'.
Setup:
Simple iOS single view app.
Swift package with a simple Utility class with a static func named doWork that just prints a message.
I've of course imported my package in the app's file where I need to use the utility function.
What I've tried...
For the cases where I start first with a package, then create a project and drag that project into it (always at the top-level), the package contents are hidden (no disclosure triangle). Closing the Xcode app project and re-opening now lets you view the package contents.
After adding the package as well as setting up a dependency to it in my app target settings, when compiling, it first errors on my import MyPackage line. A clean build resoves that issue, but even though the app source can definitely "see" the module now, all symbols within that module error (no member named).
Even fully resolving things fails. e.g. MyPackage.Utility.doWork()
In all cases, I'm left with a compile error of Module 'MyPackage' has no member named 'some symbol'.
Setup:
Simple iOS single view app.
Swift package with a simple Utility class with a static func named doWork that just prints a message.
I've of course imported my package in the app's file where I need to use the utility function.
What I've tried...
Created a standalone Swift Package first. Then, the app project and dragged the Swift Package into it.
As above but with a workspace instead of a project.
Started with just an app project. Created my Utility.swift file in that project. Then, created the Swift package and dragged that Utility.swift file into the package's main source folder. This is basically what is demoed in "Creating Swift Packages" (WWDC 2019). During the first part showing how to create a local package.
As with #3, but started with a workspace first.
For the cases where I start first with a package, then create a project and drag that project into it (always at the top-level), the package contents are hidden (no disclosure triangle). Closing the Xcode app project and re-opening now lets you view the package contents.
After adding the package as well as setting up a dependency to it in my app target settings, when compiling, it first errors on my import MyPackage line. A clean build resoves that issue, but even though the app source can definitely "see" the module now, all symbols within that module error (no member named).
Even fully resolving things fails. e.g. MyPackage.Utility.doWork()