Xcode12: Application Target's "Module-Swift.h" File Not Found

When upgrading from Xcode11.7 to Xcode12.0 (12A7209), after performing the basic necessary project updates and resolving any new warnings, my main app target's Swift interface header is not found when compiling. We've had a mixed ObjC/Swift app for the last ~4 years and have successfully mixed the two with this header since the beginning. With almost no changes to our project file or build settings, Xcode12 will not locate this file and so our ObjC code does not compile.

I went through and commented out all of our ObjC code that references our Swift code and commented out all imports of the Swift header, at which point the build succeeded without warnings. Re-adding a single #import "Remind101-Swift.h" line in our ObjC code yields the error again.

Different incantations of #include do not fix the issue (brackets instead of quotes, fully qualified with module name "Remind101/Remind101-Swift.h").

The file is being generated correctly; I've inspected it in the $(DERIVED_FILES_DIR) directory and its contents look correct.

Swift interface headers from other targets in my application are properly resolved and accessible from my ObjC code, both within those targets and from other targets, e.g. #import <RemindData/RemindData-Swift.h>.

The same Copy Remind101-Swift.h build command appears to be getting executed on both Xcode11 and Xcode12, with the same file paths, but Xcode12 does not successfully find the file after this.

Code Block
Ditto /Users/aleffelman/Library/Developer/Xcode/DerivedData/Remind101-apkkgwscepuagogklsdprmjnyjpa/Build/Intermediates.noindex/Remind101.build/Developer-iphonesimulator/Remind101.build/DerivedSources/Remind101-Swift.h /Users/aleffelman/Library/Developer/Xcode/DerivedData/Remind101-apkkgwscepuagogklsdprmjnyjpa/Build/Intermediates.noindex/Remind101.build/Developer-iphonesimulator/Remind101.build/Objects-normal/x86_64/Remind101-Swift.h (in target 'Remind101' from project 'Remind101')
cd /Users/aleffelman/Documents/Code/r101-ios-teacher
/usr/bin/ditto -rsrc /Users/aleffelman/Library/Developer/Xcode/DerivedData/Remind101-apkkgwscepuagogklsdprmjnyjpa/Build/Intermediates.noindex/Remind101.build/Developer-iphonesimulator/Remind101.build/Objects-normal/x86_64/Remind101-Swift.h /Users/aleffelman/Library/Developer/Xcode/DerivedData/Remind101-apkkgwscepuagogklsdprmjnyjpa/Build/Intermediates.noindex/Remind101.build/Developer-iphonesimulator/Remind101.build/DerivedSources/Remind101-Swift.h


I've added the path $(CONFIGURATION_TEMP_DIR)/$(PROJECT_NAME).build/DerivedSources/ to both the "User Header Search Paths" and "Header Search Paths" in an effort to tell Xcode where to locate the file, but even though that path resolves correctly to where the header file is, I still get the error.

Ultimately, everything was working with our mixed language project in Xcode11 and it is not working with Xcode12, and I've exhausted everything I could think of to debug the situation.
I am running into this problem as well, but it's intermittent. It happens sometimes on local Dev machines and kind of often on CI builds (which are always clean builds)

One thing I noticed is that I have file.m obj-c module files that are in both the app and a share extension. In both, I have the same #import "x-Swift.h" -- but now I am thinking that the file should import a target based one. I suspect that Xcode is cleaning the file after building the extension (or something like that).

I am going to look into that and report back in a few days if the intermittent issues seem to go away, but just wanted to leave this here in case it helps anyone.
I am facing this exact same situation after upgrading a project to Xcode 12. Have you found a fix or workaround?
Xcode12: Application Target's "Module-Swift.h" File Not Found
 
 
Q