10

Recently I updated to Xcode 6 beta 6 with iOS 8 SDK. And while running static analyser I jumped into a problem with the following errors.

error: error reading 'pic' error: no analyzer checkers are associated with '-mrelocation-model' 2 errors generated. Command /Applications/Xcode6-Beta6.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1

Any Idea what is these errors and how to fix it. Thanks.

arango_86
  • 4,236
  • 4
  • 40
  • 46
  • Dup of http://stackoverflow.com/questions/25770938/build-error-with-xcode-6-and-possibly-cocoapods – immichs Sep 12 '14 at 21:00

3 Answers3

6

It´s a issue with the clang static analyzer. Add to your existing analyzer entry under "Target" -> "Build Phases" -> "Compiler Flags" the suffix -Xanalyzer deadcode.

Complete entry should read as follows:
-w -Xanalyzer -analyzer-disable-checker -Xanalyzer deadcode

ehrpaulhardt
  • 1,607
  • 12
  • 19
  • If I add these flags the error mentioned above does not appear. However, the static analyzer issues return. Xcode 6.1 (6A1052d). – Christopher Feb 20 '15 at 17:07
2

I have solve this problem recently you can solve using go to Xcode > Preferences > Location and remove all derived data in derived data folder and then clean and analyze

  • Didn't work for me. This seems to be an issue specific to this version upgrade (including the first non-beta version). I ran into it with CocoaPods, although it could perhaps happen in other situations. – Peter DeWeese Sep 25 '14 at 13:45
  • I have xcode version for beta Version 6.0 (6A280n) my issue resolve by doing that. – Paresh Vasoya Oct 03 '14 at 10:05
0

With the above answers in Xcode 8, I noticed build errors when using Swift compilation. Here's what Compiler Flags worked for me:

-w -Xanalyzer -analyzer-disable-all-checks
Ricky
  • 3,101
  • 1
  • 25
  • 33