Thank you, Mark. The same problem persists in the official release. Fixed by your suggestion.
Hello guys, still couldn’t figure it out can anyone help , and also I tried 2-3 different ways but didn’t work. any updates?
Any news about how to fix this? I’m having the same issue and after a good week of trying stuff I have not found a solution. I tried doing a fresh install of xcode because these errors only appear for me on xcode 16.2 when I run the project on 26 its fine. If I manage to find something I will let you know.
I’m currently having the same issue on Xcode 26.0.1 but only on a UITest project. Everything worked perfectly on Xcode 16.4. Tried setting “Explicitly Built Modules” to no but still having the same issue.
But we are also using spm packages and pods together in one project. And the module that’s missing is a pod.
How can this be fixed?
In case this helps someone else:
The variable name for Explicitly Built Modules changed in the project file between Xcode 16.4 and Xcode 26, and it doesn’t appear to migrate automatically. We changed the variable on our desk computers running 16.4, checked it into github, then ran our jenkins test job and still ran into the same issue. The jenkins test job is running on a lab computer running Xcode 26. Finally running a diff on the file shows that we needed to update the variable name manually (or on an updated version) and check it back in before Xcode 26 would see the change.
Xcode 16.4 variable name: _EXPERIMENTAL_SWIFT_EXPLICIT_MODULES
Xcode 26 variable name: SWIFT_ENABLE_EXPLICIT_MODULES
Both show up with the same human readable name in Xcode build settings and if we update it in 16.4 then 26 didn’t see it. We ended up manually editing the project.pbxproj file to add the new variable name and got past this issue.
thinks,I updated Xcode to 26.01, then I saw this error.
when I turn off Explicitly built, it’s all ok.
Is not the best solution but It’s a temporary fix that works for me in order to buy me time until I migrate all the Pods to SPM.
Added user defined variable in the Build Settings SWIFT_ENABLE_EXPLICIT_MODULES = NO
This is still an issue for me with Xcode 26.1. SWIFT_ENABLE_EXPLICIT_MODULES = NO does not fix the issue for me.
I am attempting to use Local Swift Packages from a Command-Line Tool and an App Extension target. Neither of them can import the local package and fail with the Unable to find module dependency / No such module issues.
has anyone found a solution? I’ve changed “explicitly built modules” to NO, deleted Version 26.2 (17C52) and redownloaded it, started a new Xcode project and same error, deleted the Package and re-installed it and same error. The odd thing that happens is that the error shows up and then it disappears, and then it shows up again and the error stays showing. Downloaded older versions of Xcode and same error.
Try disabling User Script Sandboxing. Go to Project > Target > Build Settings, search for User Script Sandboxing, and set it to No. and also set SWIFT_ENABLE_EXPLICIT_MODULE to NO (in build setting search Explicit Modules) This resolved the issue for me in Xcode 26.0 (17A324).
I encountered a similar bug, and I successfully fixed it.
pod deintegrate
pod install
In a macOS app (AppKit) I was having this problem with the test target (Swift testing). The main app has some embedded framework dependencies and the test was complaining that the modules for those frameworks were missing (even though I was not importing them anywhere in the test target code).
I fixed it by setting the test target's framework search paths (in the build settings) to the same value(s) as the app target's framework search paths.
I got the same error after upgrading to Xcode 26.4.
Same here, downgraded to Xcode 26.3. Took a production App; multiple local SPM dependencies (let’s call them Foo, Bar; internal implementations no API leakage), to Xcode framework (Baz), 28 other Xcode frameworks, App, all combined at the end with mergable libraries– this is a complex project.
Xcode 26.4 immediately broke all 28 other frameworks which require Baz; by demanding access to Foo and Bar in each of them– even though Foo and Bar are internal SPM implementation details to Bar.
Will be filing bug report. Things that made ZERO difference: “@_implementationOnly import“, “internal import“, “@_implementationOnly internal import“. “SWIFT_ENABLE_EXPLICIT_MODULES = NO“, “BUILD_LIBRARIES_FOR_DISTRIBUTION=YES“, and making Baz a Swift Package.
Also have local packages with transitive (also local) dependencies here. SWIFT_ENABLE_EXPLICIT_MODULES=NO didn’t help, but what did fix it was creating a modulemap mirroring what would be generated by clang for the dependency in question, and including it in my project and then setting SWIFT_INCLUDE_PATHS to point at it. My dependency contained a C header and implementation, and so that explicit modulemap’s umbrella header had to specify a relative path to that header according to where it was located in DerivedData.
Broken for me in XCode 26.5. I am having trouble debugging root cause.
Dep is a rust library. No clue why it's not being included.
Found the solution
// apple/MYPROJ.xcodeproj/project.pbxproj
-PUBLIC_HEADERS_FOLDER_PATH = "include/$(PRODUCT_NAME)";
+PUBLIC_HEADERS_FOLDER_PATH = include/DEPNAME;
I think I found the culprit:
Prior to PR#100005, clang, when searching for module maps, would use the following search methods (for lack of a better term):
<search-path>/module.modulemap<search-path>/<ModuleName>/module.modulemap<search-path>/*/module.modulemap, as in, "all module maps in the immediate subdirectories of this search" by default
After PR#100005, clang now passes -fno-modulemap-allow-subdirectory-search for SDK >= macOS 15, meaning search method #3 is dead (by default).
This was first shipped in LLVM 20.1.0, which was picked up by Xcode 26.4, which is why we're seeing this now.
To fix, make sure that your modulemaps can be found via search method #1, or #2. Note that Xcode defaults ENABLE_DEFAULT_HEADER_SEARCH_PATHS to true, meaning that all consuming targets search $(BUILT_PRODUCTS_DIR)/include by default.
