Objective-C runtime differs in PCH file and SwiftShims errors in macOS Catalina 10.15.6, Xcode 11.6, Mac Catalyst app

140 views Asked by At

When building for macOS Catalina 10.15.6 using Xcode 11.6, two errors occur:

<unknown>:0: error: target Objective-C runtime differs in PCH file vs. current file
<unknown>:0: error: missing required module 'SwiftShims'

These are repeated across all the Swift files in the build and prevent the app from running as a Mac Catalyst app.

1

There are 1 answers

0
sketchyTech On BEST ANSWER

This occurs when your iOS target is 13.5, adjusting it upwards or downwards in your app target's General > Deployment Info setting will resolve the issue.

Change from this (which generates error):

enter image description here

To this (i.e. a number higher or lower) than iOS 13.5:

enter image description here

I don't know why this happens but it reliably solves the issue and when changed back to iOS 13.5 the crash happens again.