Could not build module 'UIKit' - XCode 16 Beta 3

I have an old project that combines Objective-C with Swift and it is compiling just fine in XCode 15 but is not compiling on XCode 16 Beta 3. There are multiple errors such as:

"could not build module 'UIKit'" "could not build module 'CoreMedia'" "could not build module 'CoreLocation'"

Among the errors there is this one about failing to emit precompiled header in the Bridging header file of the project.

I've tried re-installing XCode 16 Beta 3, re-installing the simulator, restarting the computer and I've also created a sample project that also combines swift and Ojb-c and that one compiles just fine.

Any clues? Thanks!

I have the exact same issue!

Are you able to share your complete project with me privately so I can look into this? If it's in a public place, feel free to share the link here. If your project can only be shared in private, I suggest you submit a code-level support request, and I'll share a private upload location with you so we can take a look. Once I have a copy of the project, we can continue the discussion of what we find here in the forums for the benefit of everyone.

If you create the support request, indicate that you were referred by someone at Apple and make sure to include a link to this thread, and I can pick it up on the other end.

— Ed Ford,  DTS Engineer

Try to rename the file to just "Xcode" and replace the existing Xcode 15 in Applications. That fixed my issue.

@DTS Engineer Any update on this? I have the same issue. Xcode Version 16.0 beta 4 (16A5211f)

[@Eugene Petrash](https://developer.apple.com/forums/profile/Eugene Petrash) I haven't received a project to look into. Would you care to share yours per my prior instructions?

— Ed Ford,  DTS Engineer

@DTS Engineer Unfortunately I can't share the project, as it is intellectual property of my client. It is also Objective-C heavy as person in original post described. Workaround from Ban worked, but each time I need to test beta I rename Xcode to Xcode-stable and XCode-beta and to Xcode and restart the mac. Jumping back and forth here..

I completely understand regarding client relationships. You shouldn't need to jump back and forth between Xcode versions like that.

For anyone else coming across this thread during the Xcode 16 beta lifecycle, if you encounter this and would like assistance resolving it, please refer to my prior instructions on sharing a project, and I'll be happy to take a look.

—Ed Ford,  DTS Engineer

I renamed the Xcode.app (version 15) to Xcode-15.app. Then Xcode-beta.app (version 16) no longer showed "cannot build UIKit" etc. and i was able to compile build and run my project.with Xcode 16 Beta.

Well, I gave it a try and it did work! The app in Simulator did run. Thank you for the 'patch', though it would be nice to get a real fix.

I had similar issues. My .mm file was importing the generated myapp-swift.h header. In that header was @import QuickLook That's the module that was unable to be built.

What fixed it for me was updating these build settings:

I fixed this issue by updating the following build settings for the project.

C Language Dialect to GNU17 C++ Language Dialect to GNU++23 CLANG_CXX_LANGUAGE_STANDARD to GNU++23

You may not have them all.

Could not build module 'UIKit' - XCode 16 Beta 3
 
 
Q