Nikoloutsos
(Konstantinos Nikoloutsos)
1
Hello community 
In a Xcode 15.1 in a project I am adding a SPM library.
Project >> Package Dependencies >> + >> added succesfully (without any errors)
Then I make sure that the package is added in:
Target >> Frameworks, Libraries and embedded content
Everything is going well until I am trying to import that SPM. It says "No such module found".
Here is what I have tried so far:
- I tried to do this in a fresh project and it worked well.
- I tried creating a new app target in same project and still did not work.
- I tried comparing the buildSettings but I did not find something worth mentioning.
- I tried changing the configuration from main to use Debug prefix.
- I tried with other SPM but with no success.
- I tried deleting DerivedData and clean build many times.
Is there something that makes SPM not linking the library? I am also attaching the results of the xcodebuild -showBuildSettings command if you can find something.
Can someone shed a light on this one? Thank you in advance.
Diggory
(Diggory)
2
[edit] - I made a test project and it worked, but I see now that you have already tried that...
Nikoloutsos
(Konstantinos Nikoloutsos)
3
Thank you for the reply @Diggory, yes doing it in another project works well as you did. The problem seems to be in this specific project and I do not know how I can find the root cause.
Any ideas or debugging tips would be highly appreciated 
Diggory
(Diggory)
4
Is the Library in the 'Link Binary With Libraries' Build Phase?
Nikoloutsos
(Konstantinos Nikoloutsos)
5
@Diggory Yes it's also in this list. It's my first time this is happening to me.
Nikoloutsos
(Konstantinos Nikoloutsos)
6
For future readers 
After hours of investigation I think I finally found the culprit behind it.
It's the CONFIGURATION_BUILD_DIR that was overriden in this project.
Changing the configuration so that it matches the CONFIGURATION_BUILD_DIR did the trick.
Seems like that SPM is using the configuration name as a CONFIGURATION_BUILD_DIR .
But the app target was making the StagingDebug-iphoneSimulator which was different.
Before:
After:
After renaming, it was working fine 
At least now I know what I need to fix.
1 Like