12

Below is the error I'm getting when building my application. Does anyone have experience with this error?

ditto: can't get real path for source '/Users/MyUsername/Library/Developer/Xcode/DerivedData/MyAppName-fwxrneawhopjkqcpeoykduytrgwv/Build/Intermediates/MyAppName.build/Debug-iphoneos/MyAppName.build/Objects-normal/arm64/MyAppName-Swift.h'

Command /usr/bin/ditto failed with exit code 1

Any help would be great!

If more info is needed, please ask. :)

Community
  • 1
  • 1
aleclarson
  • 18,087
  • 14
  • 64
  • 91
  • [Here's a thread](https://devforums.apple.com/thread/245001) I made on Apple's developer forums about my problem. – aleclarson Sep 12 '14 at 04:00
  • Check out http://stackoverflow.com/questions/24062618/swift-to-objective-c-header-not-created-in-xcode-6 – Besi Jan 26 '16 at 01:23

5 Answers5

11

Crazy right? Did the super clean, Command - Option - Shift. Cleared it up. Was stunned that it worked.

Edward Potter
  • 3,760
  • 4
  • 28
  • 39
  • Did for me too. I also had an error stating: "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed". Both disappeared. This all happened to me when upgrading to Xcode 7.2. – Lyck Dec 12 '15 at 19:09
2

I had this problem too. I realized that by commenting out most of my swift code it would build properly. Gradually, line by line, I uncommented code until I found an error in my swift code that was masked by this error. Now the app builds just fine.

Michael Wilson
  • 851
  • 6
  • 13
  • 1
    I only had this problem with my Swift framework. Once I decided to just add the framework's source code to my project directly (rather than building it as a a framework) did it work properly. Quite strange. – aleclarson Sep 16 '14 at 07:16
0

I had this issue, when I accidentally removed some swift file from disk.

Igor Palaguta
  • 3,579
  • 2
  • 20
  • 32
0

Just Clean and build the code, it will work fine. clean -> shift + command + K.

0

Do a "Super Clean"

  1. Clear derived data folder Xcode, Preferences, Locations, Click First Arrow

  2. Clean build folder Command + Alt + Shift + K

  3. Clean Project Command + Shift + K

Restart Xcode for good measure. MAGIC

Community
  • 1
  • 1
Kouder
  • 33
  • 8