Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apple Mach-O Linker & Ditto Error - Xcode 8

I have just updated my Xcode to Xcode 8 and am now trying to convert my project's code to Swift 2.3. I was able to build a couple times using Xcode 8 without any errors. Now, the following errors came up:

Error #1: Apple Mach-O Linker Error: Linker command failed with exit code 1

ld: file not found: /Users/Linus/Library/Developer/Xcode/DerivedData/MyApp-asdjeshhsetnfxbegcsbcipdreneewgr/Build/Intermediates/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/x86_64/DownloadsViewController.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I don't even know what a .o file is. The swift file of DownloadsViewController is there, though.

Error #2: Ditto Error: Command /usr/cin/ditto failed with exit code 1

ditto: can't get real path for source '/Users/Linus/Library/Developer/Xcode/DerivedData/MyApp-asdjeshhsetnfxbbciegrfdpdreneewgr/Build/Intermediates/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/x86_64/MyApp-Swift.h'
Command /usr/bin/ditto failed with exit code 1

The ditto error occurs 3 times: for MyApp.swiftdoc, MyApp.swiftmodule, and MyApp-Swift.h.

Thanks in advance!

like image 750
LinusGeffarth Avatar asked Sep 17 '16 10:09

LinusGeffarth


3 Answers

  1. Quit Xcode
  2. Restart the System
  3. Select Xcode -> Preferences.
    This will open a pop-up window. Select 'Locations'. In Locations, you will see 'Derived Data'. Click on the arrow icon right next to the path.
    This will open a folder containing 'Derived Data', delete it.
  4. Clean the Product and Run
like image 75
RakeshDipuna Avatar answered Nov 05 '22 21:11

RakeshDipuna


Make sure you open the project from the .xcworkspace file instead of the .xcodeproj

like image 27
Agu Dondo Avatar answered Nov 05 '22 21:11

Agu Dondo


step 1 = clicking on the project in the navigation menu

step 2 = select the project

step 3 = build settings

step 4 = search enable bitcode if bitcode is yes than change to No

like image 17
Parth Changela Avatar answered Nov 05 '22 20:11

Parth Changela