About the author

Related Articles

19 Comments

  1. 1
    Sandr@email.null'

    Sandr

    May be it will be helpful for someone:
    I had the same error after deleting several files from project. After having deletes committed in git repository this error has gone…

    Reply
  2. 2
    Nimmy@email.null'

    Nimmy

    Try this – click on the name of your project on the list of files/folders on the left in Xcode (at the very top of the list). Look at the “Targets” section on the left-hand side of the window to the right. Likely, there’s two listed with the second being a “test” item. Right-click on that item and select “delete”. Then try to run the project again.

    Reply
  3. 3
    Zaid

    Zaid Pathan

    Xcode 8

    @Spoek’s answer is right,

    But If you won’t find file in red color, then find the one with low opacity,

    see this image,

    enter image description here

    The first one is there but second one is note there, so delete it.

    Reply
  4. 4
    Neeraj

    Neeraj Pathak

    This problem usually occurs when there are more than two versions of XCode are installed in which different Swift versions incorporated for Ex. XCode 6.4 and XCode 7.3 are installed which are running Swift 1.2 and Swift 2.0. By mistake you tries to compile code with icorrect version for Ex. your project in in Swift 1.2 and you tries to compile it with xcode 7.3. In this case drive data stores information for swift version but when you tries to compile code with correct XCode it gives error.
    To resolve this

    1. Delete drive Data
      a. In Xcode select preferences

    enter image description here

    1. Once preferences are open click on Location tab and click on the arrow in front of the ‘Drived data’ path. It will open drived data folder

    enter image description here

    1. Quit Xcode
    2. Delete all drive data.
    3. reopen the project in correct XCode error is fixed !!!!!!
    Reply
  5. 5
    TharakaNirmana@email.null'

    TharakaNirmana

    deleting ~/Library/Developer/Xcode/DerivedData helped me.

    reference : link

    Reply
  6. 6
    Ricardo@email.null'

    Ricardo

    I face this problem too. And ofc I looked for help in SO instead of use the common sense and check the error message.

    The last part of the error message was the same as you.

    Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 11
    

    But few lines above I found:

    In file included from /Users/Ricardo/Documents/XCode/RealEstate-Finder-v1.2/RealEstateFinder/RealEstateFinder/RealEstateFinder-Prefix.pch:26:
    /Users/Ricardo/Documents/XCode/RealEstate-Finder-v1.2/RealEstateFinder/RealEstateFinder/Config/Config.h:174:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
    http://www.myserver.com/apps/mobile/rest.php?id=12
    

    Which points to my Config.h file.

    Happy coding!

    Reply
  7. 7
    longilong@email.null'

    longilong

    For me this error appears after cloning the project from a repository. Someone removed a white space from the projects name (renamed: “The Project” to “TheProject”) which caused some Build Settings errors to unvalid paths.

    Sometimes reading the whole error logs is not a bad idea….

    Reply
  8. 8
    Jeffrey

    Jeffrey Sun

    My problem was that under Build Phases -> Compile Sources, I added a compiler flag for a file, but I had misspelled it. It was supposed to be:

    -fno-obj-arc
    

    to show that this file does not use ARC.

    Reply
  9. 9
    Rudiger@email.null'

    Rudiger

    Had this happen in a team using git. One of the team members added a class from an external source but didn’t copy it into the repo directory. The local version compiled fine but the continuous integration failed with this error.

    Reimporting the files and adding them to the directory under version control fixed it.

    Reply
  10. 10
    Spoek@email.null'

    Spoek

    Project Settings > Under “Targets”, select your project > Build Phases >
    open “Compile Sources” and “Copy Bundle Resources”. Check if any files are listed in red color. If so , just delete it. Then clean and run.

    Worked for me.

    Reply
  11. 11
    badweasel@email.null'

    badweasel

    This happened to me and it took me an hour to find it. In my case I had typed too fast and did:

    [seld method];
    

    instead of:

    [self method];
    

    Seriously! I don’t know why it didn’t catch this in a more recognizable way. But it was of course looking for a class called “seld”.

    Reply
  12. 12
    i_duhh_bomb@email.null'

    i_duhh_bomb

    The same thing happened to me and i found that i forgot to put the ” at the end of the

    #import "CPDConstants.h
    

    so instead

    #import "CPDConstants.h"
    
    Reply
  13. 13
    fnc12@email.null'

    fnc12

    Go to target preferences, summary tab, find “Deployment target” and increase it.

    Reply
  14. 14
    redux@email.null'

    redux

    Do a clean. product > clean . Terminal purge & reboot didn’t work for me, cleaning did.

    Reply
  15. 15
    smileBot@email.null'

    smileBot

    The thing to consider here is the *.pch file. If you’re doing an include from an external library then you have to make sure you’re doing the include after #ifdef OBJC and before #endif. If you try to do your include outside this condition this might be a cause of the compiler error.

    Reply
  16. 16
    CodaFi@email.null'

    CodaFi

    You have accidentally included the .m file OverlayManager instead of the .h file inside the actual OverlayManager class itself! Basically, he compiler already knows to compile the .m file, but when you #import it, the compiler tries to include it inline with that same source file, thus generating duplicate symbols. But your case is unique, seeing as you are #importing the .m of the actual class’ .m file! It’s recursively compiling your OverlayManager class.

    Reply
  17. 17
    Eddie.Power_AU@email.null'

    Eddie.Power_AU

    I too had this error. But in my case, and I’m sure I’ll be a one off here, I had accidentally deleted main.m when I hit the delete key after the app had crashed on the iPhone simulator.

    After a crash, Xcode shows the main.m file and when I had hit delete, I had accidentally deleted the main.m file from my project, as it is easy to do when a file name is highlighted, not the code in the detail view.

    Main.m normally resides in a group or folder named supporting files in the project file manager. I had not noticed this happened until it failed to build and run next time around and then I had to re-read the error message more closely and saw it said main.m is missing.

    Thank you all for your input, but just in case there is someone in my position check for any file names in red showing missing files and restore them from a backup if you have it.

    Reply
  18. 18
    Akbar@email.null'

    Akbar

    Adding the missing files(files in red color in Xcode->target->Build Phases->compiled sources) to the target folder resolved the issue for me.

    Reply
  19. 19
    Boeckm@email.null'

    Boeckm

    I had this same error and nobody seems to have an answer on StackOverflow that actually works. My problem was when I tried copying a project that was in a team repository. Turns out, in the ignore file, all files with the extension of *.pch were ignored from repository commits. This means that when I went to pull the project from the repo, the .pch file was missing, thus throwing this error.

    Fortunately I had a copy of the project still and was able to just copy the .pch file over and I was then able to compile just fine.

    Hope this helps?

    Reply

Leave a Reply

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

Copyright © 2017 SolutionMmyself.com