Apple Mach-O Linker Error ZBarSDK error when build

2020-05-20 03:33发布

I just got this same error when using ZBarSDK, a bar scanning library for iOS. It runs fine when I upload it to my development device or test it on the iOS6 simulator. But when I try to run it for Distribution it fails with:

(null): File is universal (3 slices) but does not contain a(n) armv7s slice: /Users/quique123/Documents/iphone apps/ScanThis/ZBarSDK/libzbar.a for architecture armv7s

where libzbar.a is the library from the sdk.

Any ideas?

标签: linker ios6
7条回答
萌系小妹纸
2楼-- · 2020-05-20 04:00

When you have your target selected > Build Settings (All) > Architectures > Valid Architectures.

When you get the above error, remove the armv7s (probably says [armv7 armv7s] now) by double clicking the line and select armv7s and press the (-) button.

In my case, this solved the error. Not sure if this will have any downsides further on..

EDIT: now I am sure this has at least one downside: The project is not buildable for an iPhone 5. The solution for that, is recompiling the ZBar sources, as stated here: ZBar library for iPhone 5(ARMV7s)

查看更多
登录 后发表回答