问题
I've just upgraded my app to run on the new iPhone5 simulator, however when I try to build it for my iPhone 4S device, I get this Apple Mach-O Liner error.
ld: file is universal (3 slices) but does not contain a(n) armv7s slice: /Users/Darren/Documents/Dev stuff/My App/GoogleAdMobAdsSDKiOS-5.0.5/libGoogleAdMobAds.a for architecture armv7s clang: error: linker command failed with exit code 1 (use -v to see invocation)
Can someone shed some light on what this error it and how to fix it? I am using adWhirl with AdMob.
Thanks
EDIT --- I am also getting this error in another project for the file libfacebook_ios_sdk.a
回答1:
The same answer as I gave in this thread:
If you want to remove the support for any architecture, try this:
Project -> Build Settings -> remove the architecture from "valid architectures"
You can use this as a temporary solution until the library has been updated. You have to remove the flag from your own project.
回答2:
iPhone5's cpu is A6(armv7s). The existing Admob sdk does not support it. We have to wait for admob to update the sdk.
回答3:
Update to Admob 6.2.0 or later.
See this post: http://googleadsdeveloper.blogspot.com/2012/09/migrating-to-admob-v62-for-ios.html.
Also, include the AdSupport framework and remove the -all_load flag. You've got to use the -ObjC flag however.
This works for me, finally!!
回答4:
Try this:
This article copy an armv7 lib code as an armv7s and build into the original lib. so xcode will see that lib has an armv7s code/arch
http://www.galloway.me.uk/2012/09/hacking-up-an-armv7s-library/
来源:https://stackoverflow.com/questions/12403630/apple-mach-o-linker-error-armv7s-libgoogleadmobads-a