Swift Macro: Missing package product 'MyFirstMacro'

300 Views Asked by At

In Xcode 15.0.0, I have created a package using a Swift Macro template. I named it 'MyFirstMacro'. The template includes a #stringify macro. Next, I created a new application named 'MyApp' and copied the code from the 'MyFirstMacro' main.swift file:

import MyFirstMacro

let a = 17
let b = 25

let (result, code) = #stringify(a + b)

Then, I added a local package dependency to the application project and selected the package product 'MyFirstMacro' with a Library kind for my 'pocApp' target.

However, when I run the project, I encounter the error:

No such module 'MyFirstMacro'.

How can I fix it?

1

There are 1 best solutions below

1
On

I had a similar issue but when I was creating a Macro package and running it standalone and seems like it was the bug which was fixed in Xcode beta 2.