Solved: Xcode 7 Static Library Warnings

By Victor Quinn  |  September 26, 2015

This entry was posted in iOS, LocationKit tagged


When Xcode 7 was officially released on Sept 16, feedback from developers started flowing in that they were seeing a ton of warnings building their apps with LocationKit, our advanced location manager framework for iOS (and Android too, but of course that was unaffected here!).

We started scouring the web for similar issues and were unable to find much information about the issue as apparently it was brand new. So, after a lot of blood, sweat, and tears, our team finally solved it.

As with most annoying problems, the solution seems very simple and obvious in retrospect, but it took us awhile to arrive at. So I’m writing this in the hopes that it’ll help other developers compiling static libraries for iOS on Xcode 7.

The problem

When developers were using our LocationKit static library in their apps built on Xcode 7, they were seeing a ton (hundreds!) of warnings that looked like the following (it scrolls far to the right!):

We noticed they were present and included a lot of the core iOS libraries on which we were dependent, so in our case we saw errors including Foundation, CoreLocation, CoreMotion, and MapKit among others.

This was the same build of our static library which worked without any problems or warnings when added to an app built with Xcode 6, now blowing up in an app built with Xcode 7.

One notable problem with these warnings — the warnings included /Users/victor/ which would make sense on my laptop (since my name is victor and my user is victor so the path /Users/victor/ made sense for me), but it sure didn’t make sense for anyone else to be seeing those warnings with a path on my machine appearing when building their app! And that’s exactly what they were reporting.

Some more investigation and we discovered that, since LocationKit had been compiled on my laptop, when I compiled an app with LocationKit integrated (part of our standard release process), I had zero warnings because those paths existed on my local machine.

But as soon as someone else compiled an app with LocationKit in it, they would see all of the warnings referencing a path on my machine, the machine on which LocationKit had been built!

The solution

It appears Apple made some changes to the default compilation behavior in Xcode 7 which caused those warnings to be thrown. So, we made the following changes which fixed our issue and stopped LocationKit from throwing these errors when added to an app:

  1. Under the Project Target > Build Settings, change the “Debug Information Format” from “DWARF with dSYM File” to “DWARF”, particularly for Release. See attached screenshot (click for full size image): LocationKit_xcodeproj_and_Edit_Post_‹_LocationKit__Free_Location_Manager_SDK_for_mobile_apps__iOS___Android_Location_SDK_—_WordPress
  2. Alter the following build settings to inhibit such warnings:
    • Deployment Postprocessing = Yes (DEPLOYMENT_POSTPROCESSING=YES)
    • Generate Debug Symbols = No (GCC_GENERATE_DEBUGGING_SYMBOLS=NO)
    • Symbols Hidden by Default = Yes (GCC_SYMBOLS_PRIVATE_EXTERN=YES)

Hopefully this will help other developers building Static Libraries on iOS and Xcode 7.

Of course, if you’re a developer building a mobile app using location, I urge you to try out our free LocationKit SDK today, and you shouldn’t get any warnings on compilation 😉

You should follow me on twitter @victorquinn


No comments yet.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">