Cannot find swift package module in release build

I have created a swift package and successfully added some stub code, imported into another class

import PackageName

This all works as expected when building in debug configuration.

When I try to build for release using xcodebuild, it fails with

"no such module : PackageName"

Is there something missing that dictates how a package works in different configurations?

Thanks
Could you provide some more details?
  • I am assuming you're depending on the package from a target in an Xcode project, is that correct?

  • You're saying that building in debug configuration works fine, are you also doing that on the commandline using xcodebuild or are you using the IDE?

  • Could you share the full xcodebuild command that you're using when getting the error?

Hello,

It seems this has been resolved now but still perhaps an issue for others with similar setup

This is the failing command

xcodebuild clean -project {pathtoxcodeproj.} -scheme {sehemeName} -sdk iphoneos DEVELOPMENTTEAM={teamId} CODESIGNSTYLE='Manual' PROVISIONINGPROFILESPECIFIER={provisioningProfileName} -configuration AppStoreDistribution archive -archivePath {archivePath}

And this works:

xcodebuild clean -project {pathtoxcodeproj.} -scheme {sehemeName} -sdk iphoneos DEVELOPMENT
TEAM={teamId} CODESIGNSTYLE='Manual' PROVISIONINGPROFILESPECIFIER={provisioningProfileName} -configuration Release archive -archivePath {archivePath}

Only difference being the configuration. The original version has worked for months - seems like using AppStoreDistribution has only become an issue since trying to use a swift package in the project.

I am facing same issue , when I switch to release build configuration and to try create build it show error "Module not found" in -Swift.h file. It works fine when I create build with configuration "Debug" but not Working for "Release"

Cannot find swift package module in release build
 
 
Q