Xcode mach-o linker error when archiving project w

2019-08-28 18:22发布

问题:

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?

回答1:

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.



回答2:

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.