Linker command failed with exit code 1

I’ve just updated to latest XCode Version 7.1.1 (7B1005) and Unity 5.2.3f1 and my project cannot be built anymore. I’m building for simulator so I selected “Simulator SDK” in Unity build settings. “Device SDK” works fine, but I need to test it on simulators.

The error is:

ld: in /Users/alex/Desktop/Ka226_18-11-2015/ka226/Libraries/libiPhone-lib.a(GeoRingBuffer.o), building for iOS simulator, but linking in object file built for OSX, for architecture x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

I’ve tried googling some solutions but nothing helps. Also I’m not using any plugins, just plain unity project. Who knows how to solve the problem?

I think this info is relevant to the problem http://karp.id.au/post/xcode_7_linker_rules/

I’m having the same problem, and just saw this in latest release note :

  • (740343) - iOS: Fixed simulator support on Xcode 7.1.

Thanks for pointing this out. But looks like it’s not actually fixed. I’m using latest 5.2.3f1 and the linker error persists. Also tried downgrading to 5.2.2p4. Same problem.

1 Like

Bingo! 5.2.2p3 solves the issue. What a wonderful friday night

1 Like

I’m having the same problem using version 5.2.2p4.

As a workaround I have just downgraded to Unity 5.2.2p3 and the build is now succeeding. Thanks @Mr.Tsunami !

I have the same, will try 5.2.2p3

All simulator linker issues have been fixed in 5.2.3p2 (5.2.2p4 had another regression).

try to off Enable Bitcode and it will work but mhh have some the same bugg that a empty scene have about 200mb ??
When i build the archive ??
The normal folder have 40mb but its big dont now why but its big for nothing.

The archived projects will have larger size due to additional bitcode information, but this is harmless. Bitcode information size is ignored during app size limit calculations during App Store submission.

I’m still seeing this with Unity 5.3.0f4 and Xcode 7.1 (7B91b). Using otool from the command line, you can see that libiPhone-lib.a still has some code marked as built for MacOSX. It would be nice if there is a way to set a linker flag in xcode that relaxes the assertion, but I have not found any.

Any fix for this? Having the same problem on unity 5.3.0f4 and xcode 7.2

I’m seeing this too (Xcode 7.2 (7C68), Unity 5.4.0f4 Personal):
… Libraries/libiPhone-lib.a(apicontext.o), building for iOS simulator, but linking in object file built for OSX, for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I’m seeing the same error as mitchallen with Xcode 7.2 (7C68) / Unity 5.3.0f4 Personal, and cannot build for the Simulator. I tried setting ENABLE_BITCODE to both YES and NO, but it doesn’t make a difference.

Same here. Unity 5.3.0f4. XCode 7.2.
I noticed in XCode that the target’s base SDK is iphonesimulator (SDK not found) and architecture was i386.
Switched to Base SDK of most recent (iOS 9.2) and Architectures to standard (these are the settings I’d have in a native app). Bitcode was off by default.
Builds OK, but the app crashes with Symbol not found:

Really need a fix on this! Or at least a workaround.

EDIT:
They closed issue Unity Issue Tracker - [iOS] Linker error on iOS simulator build
in 5.2.3f1, I’ve submitted a new bug, but not sure how long they take to show on issue tracker. Will try to update here as I find information.

The fix will be released in Unity 5.3.1.

Great! How long until 5.3.1 is released?

I’m still seeing this error in Unity 5.3.1

:frowning: same problem, first time build for ios

I’m seeing this error in Unity 5.3.1p1