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

IosObjective CXcode7Xcode7 Beta4

Ios Problem Overview

I recently integrated Google Cloud Messaging into an app targeting iOS 7 and iOS 8. Just grabbed Xcode 7 beta 4 to get started on iOS 9 support, and now I'm getting an error from the linker:

ld: warning: object file (.../Pods/GoogleInterchangeUtilities/Libraries
/libProtocolBuffers.a(Descriptor.pb.o)) was built for newer iOS version (8.3)
than being linked (7.0)

and a handful more like that all for parts of libProtocolBuffers.a.

Does this mean that iOS 8.3 is required to use the GCM library? If so, why did Xcode 6 happily spit out code that (by all appearances in my testing with iOS 7 devices) delivered push notifications to iOS 7.3 without issue?

Given that they're just warnings, I can still compile fine, however I prefer not to ship code that is wrong.

Edit: I emailed google and they said top people will look into it. In the mean time, if you're reading this and bothered by the warning, maybe also email so they'll be encouraged to deal with it.

Ios Solutions

Solution 1 - Ios

It actually means that the Minimum Deployment Target of the included library was is to 8.3 and linking it with lower Minimum Deployment Target produces this warning.

Library does not officially support targets lower than 8.3 in this case. While linking this library to target with ower Minimum Deployment Target will still work, it might produce crashes at runtime, if any 8.3 only code is executed on a device that runs older system than 8.3.

There is a reason why developers set 8.3 as the minimum target and this warning should NOT be ignored. It might be harmless in this case, but it is not necessarily harmless in other cases!

To fix these warnings, either use an older version of the library or set your Minimum deployment target to 8.3.

Solution 2 - Ios

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).

Solution 3 - Ios

My way to fix:

  1. Check "Deployment Target" is equal to Podfile "Platform"
  2. Delete DerivedData (/Users/yourUser/Library/Developer/Xcode)
  3. Pod install (Terminal)
  4. Clean/Build Project

P.s. Can add more info if needed.

Solution 4 - Ios

In targets/Build Settings/Linking/Other Linker Flags ,add

> -w

silence the warning for me.

Solution 5 - Ios

FYI, the latest version of the relevant pods seems to have fixed this issue.

Specifically, it looks like it was the upgrade of GoogleInterchangeUtilities from 1.0.0 to 1.1.0 that did the trick.

If you're seeing this, a "pod update" should make it all better!

Solution 6 - Ios

In my case the reason was that I just updated pods then changed deployment target to lower then it was before and got such warnings. Running pod update again solves the issue.


All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJony ThriveView Question on Stackoverflow
Solution 1 - IosLegolessView Answer on Stackoverflow
Solution 2 - IosevanescentView Answer on Stackoverflow
Solution 3 - IosOMGHaveFunView Answer on Stackoverflow
Solution 4 - Ioswj2061View Answer on Stackoverflow
Solution 5 - IosCodiakView Answer on Stackoverflow
Solution 6 - IosInjectiosView Answer on Stackoverflow