Xcode build failed - Assertion failed: (memberIndex != 0), function makeObjectFileForMember

Greetings,

I get this error every time I try to build my project in Xcode 7.1 with Unity 5.1.4+ versions:

Assertion failed: (memberIndex != 0), function makeObjectFileForMember, file /Library/Caches/com.apple.xbs/Sources/ld64_PONDEROSA/ld64-253.6/src/ld/parsers/archive_file.cpp, line 355.
clang: error: linker command failed with exit code 1 (use -v to see invocation)

If I build the Unity project on Unity 5.1.3 it builds fine on Xcode, but any version higher than that I get the above error.

I have tried to clear the cache as someone suggested in a forum post, but the error still happens.

Any help will be appreciated…

BUMP

BUMP

Could you please submit a bug report with a reproduction project so that we can look into the problem? Thanks

Thanks for the reply.

I have since tried it in a friend’s Mac, and the xcode project builds fine. So the problem is in my xcode/Mac. I know this isn’t really the right forum to ask this, but does anyone know what could cause this error while building in xcode?

It might be that Xcode command line tools are old. Could you try updating them?

I have reinstalled Xcode to version 7.1.1, I have installed OSX El Capitan, the command line tools version is the same as the Xcode.

The error is at linking time while building the project in Xcode:

Assertion failed: (memberIndex != 0), function makeObjectFileForMember, file /Library/Caches/com.apple.xbs/Sources/ld64_PONDEROSA/ld64-253.6/src/ld/parsers/archive_file.cpp, line 355.
0 0x10c6237e2 __assert_rtn + 144
1 0x10c660ece archive::File::makeObjectFileForMember(archive::File::Entry const*) const + 1138
2 0x10c66087c archive::File::justInTimeforEachAtom(char const*, ld::File::AtomHandler&) const + 122
3 0x10c676f09 ld::tool::InputFiles::searchLibraries(char const*, bool, bool, bool, ld::File::AtomHandler&) const + 265
4 0x10c68024c ld::tool::Resolver::resolveUndefines() + 160
5 0x10c6825ab ld::tool::Resolver::resolve() + 79
6 0x10c624500 main + 812

This only happens in my Mac AND with projects done with Unity 5.1.4 and later versions. And it happens with every project, even with a mostly empty test project…

If I use Unity 5.1.3 I can build the Xcode project just fine.

I’m really lost here… I’m used to Windows so my experience with Mac and Xcode is very limited.

Could you submit a bug report with attached project?

Done, case number 745779. But I can’t see what can be done if this only happens in my system.

Thanks, we’re investigating.

Meanwhile I have formatted my Mac Mini and the issue was resolved… No idea what caused it though.

I got exactly same error on Unity 5.3.2f, Xcode 7.1.1.
I tried to clean cache, reboot, but not worked.
Two days after, I worked around this!

This happened when Unity settings are below.

  • Release build
  • Development build unchecked

So I worked around only to do below

  • Debug build on Unity
  • change to Release on Xcode

I am getting the exact same error while making a build for tvOS, and the work around mentioned above isn’t working.

I really don’t wanna format my mac, can anyone help ??

You could try to remove various caches that Xcode uses. First start with this directory:

/Users//Library/Developer/Xcode/DerivedData/

And if that does not help, try removing this one:

/Users//Library/Developer/Xcode/

Note that Library is a hidden folder, you either need to remove the directory via Terminal or enable the hidden file display option in Finder.