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:
- Enter this command in your terminal:
sudo xcode-select --switch /Applications/Xcode.app
- 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
3 Component Dynamic Multi UIpickerview Swift
Swift: Mkannotation Long Title Text
How to Create Generic Closures in Swift
Dynamictype of Optional Chaining Not The Same as Assignment
Swiftui Remove Transition of Fullscreen Cover
Change Color of Row Programmatically in Watchkit
Wkwebview Calayer to Image Exports Blank Image
How to Enable a Button in Different Cases in Swift
Non-Translucent UItabbar Creates Strange Grey Bar
How to Create Viewcontrollers Without Storyboard and Set One as Delegate of The Other One
How to Use Gpx File for UI Tests Only
Swiftui: Unable to Animate Images
Show Status Bar Only for iPhone X
Error Combining Nscalendarunit with or (Pipe) in Swift 2.0
How to Set a Known Position and Orientation as a Starting Point of Arkit
Macos App Sandboxing - Read Access to Referenced Files from Parsed Xml
Firestore - Creating a Copy of a Collection
How to Create Rounded Image with Border and Shadow as Mkannotationview in Swift