Xcode 26: Unable to find module dependency

With Xcode 26 beta I get the following error in my project for all my local packages:

Unable to find module dependency

This happens only when I build for macOS. The project builds without any issues with Xcode 16.

Edit: Also does not build when building for a real iOS device.

Do you use CocoaPods? It seems CocoaPods doesn't work with Explicitly built modules which are turned on in Xcode 26. If you enable it in Xcode 16 then it also breaks there.

1 Like

I use local SPM modules.

1 Like

I guess try turning off explicitly built modules anyway?

I just tried it, same error.

1 Like

I'm getting the same issue. Any resolution?

1 Like

I haven't found a solution. However, creating a new project and adding all the files and settings worked.

I'm using XcodeGen to build my Xcode Project and a local Swift Package dependency.

2 things fixed this:

  • ONLY_ACTIVE_ARCH: YES
  • Fix all dependency warnings on Swift Package:

    is missing a dependency on because dependency scan of Swift module discovered a dependency on ...

Same issue, I got:

Unable to find module dependency: 'Testing'

When I add dependency Testing, the app crashes during launch with error : Library not loaded: @rpath/Testing.framework/Testing

Did anyone solve this issue? I have the same for one of my cocoa pods libraries (libsignal/swift at main · signalapp/libsignal · GitHub)

I'm also experiencing this issue for a Cocoapods package. Any updates?

I received a similar error after loading a personal project into Xcode 26 beta 4 for the first time. The specific error was:
"Compilation search paths unable to resolve module dependency: '_Testing_Foundation'"

After reading this thread, I turned off "Explicitly Built Modules" in the target and that fixed the issue.

One user mentioned that after setting that build setting to NO, to fix SPM build problems and then turn it back on. I tried that and I still got the error message.

So, my conclusion is that this is a bug in the compiler/linker that will soon be fixed in future betas. I'd create a FB, but I am not sure how to replicate it in a simple project.

1 Like

After turning off Explicitly Built Modules, it only leads to an other issue (not sure if this is progress or not)

The new error says “Failed to import bridging header…”
Has anyone seen this?

I am also building an app with Xcode 26 beta 5, but I am unable to resolve the import dependency of opencv2. I can build it by turning off explicitly built modules, but I am unable to use some of the app's functions, so I would like to know if there is another way to fix this.

1 Like

Xcode 26 beta 7 is giving me all these compile errors. When I turn off explicitly built modules I get a different set of errors. I broke something badly :frowning:

Beta 7 started giving me the _Testing_Foundation issue described above and none of the suggestions fixed it. What did fix it was that I realized I had files with import Testing on my main target. Fixing that is what did the trick.

I get the same issue on XCode26 RC in a cocoapods project for the dependency Nimble and tested turning off explicitly build modules and setting ONLY_ACTIVE_ARCH to yes but it still does not work.

Has anyone found a solution to this issue yet?

I’m seeing this with Xcode 26 RC1, but we only use local swift packages. We only see the errors when we build for testing. One of the packages raising the warning has an explicit dependency on the other, so I have no idea what this warning is trying to tell us. Turning explicitly built modules off and only building active architecture doesn’t not help.

let package = Package( name: "ios-ui-library", platforms: [ .iOS(.v16), ], products: [ .library( name: "DesignSystem", targets: ["DesignSystem"] ), .library( name: "FoundationPod", targets: ["FoundationPod"] ), .library( name: "Theme", targets: ["Theme"] ), ], dependencies: [ .package(url: "https://github.com/onevcat/Kingfisher.git", from: "8.4.0"), .package(url: "https://github.com/SnapKit/SnapKit", from: "5.7.0"), ], targets: [ .target( name: "DesignSystem", dependencies: [ .target(name: "FoundationPod"), .target(name: "Theme"), .product(name: "Kingfisher", package: "Kingfisher"), .product(name: "SnapKit", package: "SnapKit"), ], swiftSettings: [ .enableExperimentalFeature("StrictConcurrency"), ] ), .target( name: "FoundationPod", dependencies: [], resources: [ .process("Resources"), .process("Assets.xcassets"), ], swiftSettings: [.enableExperimentalFeature("StrictConcurrency")] ), .target( name: "Theme", dependencies: [ .target(name: "FoundationPod"), // Explicit dependency here ], swiftSettings: [.enableExperimentalFeature("StrictConcurrency")] ), .testTarget( name: "DesignSystemTests", dependencies: ["DesignSystem", "FoundationPod"] ), .testTarget( name: "FoundationPodTests", dependencies: ["FoundationPod"] ), ] ) 

In one of the files in the Theme package, we import FoundationPod.

1 Like

Trying to build our test target on XCode 26 failed with the same error. Turning off Explicitly Built Modules for the test target worked.

2 Likes

Worked for me as well, although I don’t understand why