Swift package manager and custom build configurations

Hello everyone, we are currently trying to move some projects to use Swift Package Manager but we are running into an issue.

When using a custom build configuration different from Debug or Release, the modules coming from SPM are not found.

For example:

  1. We create a brand new project.
  2. We add for exemple Alamofire through SPM
  3. We create a custom build configration, using Duplicate "Debug" Configuration -> We can name it "Test" for example.
  4. Add import Alamofire somewhere.
  5. When building we get No such module 'Alamofire' error.

When reverting back to the "Debug" config there is no problem.

Is there a limitation on package manager that doesn't allow those custom build configs or is there other steps we can take to set it up?

Thanks!

I asked the same question but here Custom build configuration names

Also running into this issue right now :(

@LaurentHBrunet I'm running into the same issue. Do you have a potential workaround?

This is a known issue that Apple folks are tracking internally. Currently, Swift packages default to the "Release" configuration when anything other than Debug and Release is used. In theory, adding $(BUILD_DIR)/Release to SWIFT_INCLUDE_PATHS build setting for the custom configurations should work around this issue but it can lead to some weird errors in case something unexpected gets picked from that directory.

I tried it and it did not work for me. are you sure that this should work?

Terms of Service

Privacy Policy

Cookie Policy