37

The app crashes on launch when running from XCode 10.2 (before and after Swift 5.0 migration) with this on console

This copy of libswiftCore.dylib requires an OS version prior to 12.2.0.

I understand the error, but not sure what is required to fix this.

msk
  • 8,885
  • 6
  • 41
  • 72

6 Answers6

69

Go to BuildSettings -> Linking -> runpath search path and add

/usr/lib/swift

as your 1st argument like this:

Image of dialog

Druckles
  • 3,161
  • 2
  • 41
  • 65
A H
  • 726
  • 5
  • 2
46

Make sure /usr/lib/swift is the first argument for runtime search paths for linker if iOS >= 12.2, it should load platform libraries.

msk
  • 8,885
  • 6
  • 41
  • 72
31

Got it fixed in our ObjectiveC-only project by adding empty Swift file. Don't remove it, just keep it there forever!

CrazyJoeLv
  • 570
  • 3
  • 6
  • This is ugly but it works. Did not try adding the swift lib to the runtime search paths, which may have also fixed the issue, and would be more elegant, but its late in the day and im looking for quick wins at this stage. – Ryan Knell May 14 '19 at 06:06
  • Was having the same issue while integrating lottie in react native ios. This answer worked off the bat. – amar Aug 12 '19 at 05:05
  • Mine fixed too, I dont know why? – muyoungko Aug 14 '23 at 08:23
4

For anybody not using BUCK but still experiencing this issue, try adding /usr/lib/swift in your target's Runtime Search Paths (under Build Settings). Instantly fixed things up for me.

adamup
  • 1,508
  • 19
  • 29
0

This worked for me:

  1. Go to "Window" tab -> "Devices and Simulators"
  2. Switch to "Simulators" tab
  3. Click on "+" in bottom left corner
  4. Select "iPhone X" (or whatever device you see in console error) in "Device Type" select
  5. Click "Create"
Demyd Ganenko
  • 108
  • 1
  • 9
0

Check that the version of iOS Deployment Target in Build Settings are installed correctly, especially when you use app extensions (todayextension, shareextension) all versions must be the same.

True Hekka
  • 79
  • 8