48

I'm using xcode 6. Its fine to clean but it fails when I choose clean build folders.

enter image description here

angelokh
  • 9,426
  • 9
  • 69
  • 139

4 Answers4

72

Seems like you are restricted to create a build folder in your system root.

In XCode Menu --> Preferences --> Locations Tab --> Locations sub-tab, Change Derived Data to Relative and give any name in text box.

Have a look here which is also a permission problem in Xcode.

Community
  • 1
  • 1
Avinash Babu
  • 6,171
  • 3
  • 21
  • 26
  • 66
    Same as above, but I only needed to toggle from Default->Relative->Default. Seemed to reset it and now it works. Xcode 6.1 – mcm Nov 01 '14 at 08:59
  • 1
    Just to confirm that the toggle also/still works in XCode 6.3.1 (for me at least). – Robin Macharg May 08 '15 at 10:08
  • I had to toggle a couple of times. Make sure the error window is closed. – Suz Jun 11 '15 at 22:39
  • Also just to confirm that the toggle also/still works in Xcode 7 GM (for me at least) – neoneye Sep 22 '15 at 08:21
  • Works for me by toggle from Default->Relative->Default. Thanks @mcm! – flashlib Nov 18 '15 at 03:14
  • 2
    Update to confirm toggle Default => Relative => Default works in Xcode 7.1.1 – Olie Dec 03 '15 at 15:58
  • Wonder how to give it permission ? – onmyway133 Feb 23 '16 at 11:00
  • 3
    Just toggling Default -> Relative -> Default didn't work for me. Tried that several times. What did work for me was Default -> Relative -> Close Xcode -> Reopen XCode -> toggle back to Default. That worked on the first try. Xcode 7.2.1. – Erik van der Neut Mar 09 '16 at 05:51
  • @ErikvanderNeut Absolutely true! Looks like your solution is default now. As it works in all versions of Xcode. I am running 7.3 – efimovdk Mar 25 '16 at 09:02
  • Sadly, no combination of this worked for me. I'm on XCode 7.3.1, but a very old project - but I've definitely been getting this since XCode 6. My problem is a little different - I only get the error when I switch targets or switch simulators/devices, and randomly sometimes when I try to clean build folder the first time. If I try to clean the build folder a second time it usually works afterward. – Manu Kanthan Aug 30 '16 at 13:23
7

It could be due to Xcode bug (at least for me in Xcode 6.3.1). Toggling the location for derived data folder will fix it.

Go to Xcode > Preferences > Locations and change Derived Data to Relative, then back to Default.

Clean build folder again.

samwize
  • 25,675
  • 15
  • 141
  • 186
0

I just clean that folder in Finder, then all fine.

JerryZhou
  • 4,566
  • 3
  • 37
  • 60
0

In Xcode 14 I clicked "Clean" command which had popped up in the 3rd row from the top and that fixed it.

Doug Null
  • 7,989
  • 15
  • 69
  • 148