Kyle Clegg
Kyle Clegg

Reputation: 39480

Xcode mach-o linker error when archiving project with test targets

I'm getting mach-o linker errors pointing to missing files in my test targets when I try to create an archive, I can build and run my app on both on the simulator and device without any problems though. I've tried looking at the bundle loader and test host configurations for the test targets, and both look fine. What else could cause this?

Upvotes: 0

Views: 1007

Answers (2)

Emre Gürses
Emre Gürses

Reputation: 2180

In my statution, i solve this issue to change Bit Code Enabled from Build Settings. if you use 3.party framework in your project and these framework is not supported bit code for compression in release time. You must change Bit Code Enabled flag from YES to NO.

i hope this will help someone.

enter image description here

Upvotes: 1

Kyle Clegg
Kyle Clegg

Reputation: 39480

Not the exact solution, but I realized that I don't want or need my unit tests to run during archived builds. If anyone else is having this problem try checking your scheme's build settings to make sure your test targets are not being built when you build for archiving. Select your scheme -> Edit Scheme -> Build and uncheck Archive for your test targets.

enter image description here

Upvotes: 0

Related Questions