Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 7 Warning! was built for newer iOS version (5.1.1) than being linked (5.1)

Tags:

xcode

xcode7

I upgraded Xcode 6 project to Xcode 7 and started seeing the warning was built for newer iOS version (5.1.1) than being linked (5.1).

How to fix this warning?

like image 667
last-Programmer Avatar asked Aug 28 '15 11:08

last-Programmer


4 Answers

In my case, this warning was produced because the iOS-Deployment-Target of one of my XCode subprojects was higher (7.1) than in my baseproject (7.0). If you use cococapods, this misconfiguration can happen when you specify a wrong iOS platform version in your Podfile. In my example, I specified in my Podfile

platform :ios, '7.1' 

whereas I set the Deployment-Target in my XCode-Project to iOS 7.0. Setting the DeploymentTarget of the Subproject to the same iOS Version as the BaseProject fixes this warning.

like image 115
blacky85 Avatar answered Nov 17 '22 15:11

blacky85


Update: seems to be resolved with Xcode 7.3 (7D175). I've removed the -w flag, the warning no longer appears.

This appears to be a known bug in Xcode 7.0 and 7.1B1 (bug #21813082).

As a temporary workaround, to suppress extensive warnings, the -w flag can be added to Build Settings -> Other Linker Flags:

  1. Select your Project
  2. Select your Target
  3. Select "Build Settings" tab
  4. Scroll down to "Linking"
  5. Edit "Other Linker Flags" and add "-w"

I've only added this to the Debug build settings and inserted the following to the AppDelegate, just as reminder:

#ifdef DEBUG
#warning Linker warnings suppressed (-w in build settings)
#endif

This at least helps to quickly spot the real warnings instead of having the build results flooded with the same warning for every source (in my case 150+ warnings appeared).

like image 29
Frans Avatar answered Nov 17 '22 13:11

Frans


In my case, I had my project set to 8.4 but all the rest of the subprojects/targets are still on 9.0. Appears like it is caused by deployment target inconsistencies.

For those who are using Cocoapods:

  1. Navigate through your Pod projects and targets.
  2. Change all the deployment targets to your desired one.

Make sure all of them are similar.

like image 5
Teffi Avatar answered Nov 17 '22 13:11

Teffi


In my case, I upgraded the project to iOS 6, but the problem didn't go away.

Then I realised the target was overriding it as iOS 5.1.1. I cleared the target settings and the warnings went away.

XCode Version 7.0 (7A220).

Target settings

like image 7
Matt Avatar answered Nov 17 '22 15:11

Matt