Swift Package: Ld: Warning: Dylib Was Built for Newer Macos Version (11.0) Than Being Linked (10.15)

Swift Package: ld: warning: dylib was built for newer macOS version (11.0) than being linked (10.15)

The only simple solution worked like magic is:

  1. Enter this command in your terminal:

sudo xcode-select --switch /Applications/Xcode.app


  1. Relaunch Xcode

Credit to Arturo: https://blog.arturofm.com/solve-warning-was-built-for-newer-macos-version-xcode/

I published his answer here because I was searching for weeks on Stack overflow but non of their solutions helped me.

Swift update deployment target to match package requirement

I managed to fix it by explicitly setting a supported platform version in package.swift in my own package, which I use" in this project. The relevant part now looks like this:

let package = Package(
name: "Swiftodon",
platforms: [
.macOS(.v10_15),
.iOS(.v13),
.tvOS(.v13),
.watchOS(.v6)
],

Xcode 7 warnings: object file was built for newer iOS version than being linked

This just means that one of the libraries(Protocol Buffers here) GCM depends on was built for 8.3 although it's compatible with the min sdk version of GCM i.e. 7.0. XCode 7 is just more severe and reports it as a warning but it was always there just not being reported by previous versions.

Overall this is just harmless, everything should work fine. Also there is not much that you can do unless Google patches GCM by building all of it's dependencies with the min sdk version (7.0).

Why am I getting: Object file was built for newer iOS version than being linked?

So my wrapper library used another library (boost) which were build for 10.2. This made my library build for higher version even though otool and xcode indicated something else and didn't give any errors when I build the library... Now I've stopped using the wrapper library (this is how I figured it out) and thereby cleaned up this mess as well.



Related Topics



Leave a reply



Submit