Xcode – Unity build to xcode with gives error: Apple Mach-O Linker

unity3dxcode

I tried to google for the solution. I tried to delete the DerivedData folder but it still doesn't work… Why is this still happening? I am using Xcode version 6.2. Thanks.

Edit: Under the one error has 70 different errors saying various things. There is a warning saying
ld: warning: ignoring file /Users/Kevin Chen/Desktop/Parking Director/Libraries/libiPhone-lib.a, missing required architecture arm64 in file /Users/Mushrooms4Eva/Desktop/Parking Director/Libraries/libiPhone-lib.a (2 slices)

All of the following links and solutions did not work for me:

https://teamtreehouse.com/forum/apple-macho-linker-error-xcode-61

Apple Mach-O Linker Error when compiling for device

Best Answer

Sounds like your library libiPhone-lib.a is not compiled for arm64, but your project is set to be compiled for this architecture.

I think all the errors are triggered by this "warning" as the library is ignored, and therefore you may have a lot of missing references.

Your options:

  1. Get a version of the lib compiled for arm64, or do it yourself, if you have the code
  2. Remove arm64 architecture from your project (which I don't recommend, as you'll need to provide an 64bit build for the App Store, but that's another story)

enter image description here

How to make 64bit builds (available from Unity 4.6.2+)

  1. iOS platform
  2. Other Settings
  3. Scripting Backend => IL2CPP
  4. Architecture => Universal (to target both 32 and 64 bit)

How to build for simulator

  1. Player Settings
  2. iOS platform
  3. SDK Version => Simulator SDK