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

6

38

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.

Noyade answered 26/3, 2019 at 15:39 Comment(2)
We've seen this as well on some CI jobs running Xcode 10.2.Postliminy
You folks are using Buck as well, right? I'm wondering if it's the binary version of xctest that we are using. That's my current hypothesis.Postliminy
N
47

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

Noyade answered 28/3, 2019 at 8:5 Comment(6)
Did you have to patch Buck itself for that?Postliminy
We are not using Buck and still getting this error. I wonder if there is any generic solution for this..Squiggle
We have our own fork of BUCK, where we fixed,Noyade
Is this similar to the path you used for Buck? gist.github.com/shepting/703b1eda5a4784dfd9ecb4879626bd1fPostliminy
@StevenHepting yupNoyade
I've never even heard of BUCK, but this solution worked for me! Thanks, now I can finally proceed with profiling my app.Edge
V
70

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

/usr/lib/swift

as your 1st argument like this:

Image of dialog

Vlad answered 27/8, 2019 at 7:47 Comment(0)
N
47

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

Noyade answered 28/3, 2019 at 8:5 Comment(6)
Did you have to patch Buck itself for that?Postliminy
We are not using Buck and still getting this error. I wonder if there is any generic solution for this..Squiggle
We have our own fork of BUCK, where we fixed,Noyade
Is this similar to the path you used for Buck? gist.github.com/shepting/703b1eda5a4784dfd9ecb4879626bd1fPostliminy
@StevenHepting yupNoyade
I've never even heard of BUCK, but this solution worked for me! Thanks, now I can finally proceed with profiling my app.Edge
S
31

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

Squiggle answered 29/3, 2019 at 14:44 Comment(3)
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.Almonte
Was having the same issue while integrating lottie in react native ios. This answer worked off the bat.Jonajonah
Mine fixed too, I dont know why?Anywheres
T
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.

Tews answered 13/4, 2019 at 18:46 Comment(0)
V
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"
Vichyssoise answered 27/6, 2019 at 13:10 Comment(0)
R
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.

Rattler answered 26/11, 2019 at 19:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.