Apple Mach-O Linker Error armv7s & libGoogleAdMobAds.a - ios

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

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.

iPhone5's cpu is A6(armv7s).
The existing Admob sdk does not support it.
We have to wait for admob to update the sdk.

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!!

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/

Related

How to resolve Apple - o link error

I am having one apple - o link error in my project, I have searched in Google but it's not helping me, below is my error
ld: building for iOS Simulator, but linking against dylib built for MacOSX file '/Applications/Xcode 2.app/Contents/Developer/Library/Frameworks/SenTestingKit.framework/SenTestingKit' for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
what is this error and how to fix it, please any one help me.
1.Try avoid arm64 from valid architecture.
2.Try Set Build for Active Architecture to "NO"
3.Also check framework search path
# build settings.
You can solve this by following this steps:
Select the Pods project
Click on build settings
Change Build Active Architecture Only to 'No'

Unable to link GoogleAnalytics 3.01 with XCode 5 (missing required architecture x86_64)

I have built my App (targeted for iOS7) and now want to apply Google Analytics as the last step before submission. What I did:
Downloaded GA for iOS 3.01
Imported content of /GoogleAnalytics/Library/ into group "GoogleAnalytics"
Imported libGoogleAnalyticsServices.a into group "GoogleAnalytics"
Added Build Phases and swapped build phase libGoogleAnalytics_debug.a with libGoogleAnalyticsServices.a
Added code block #include "GAI.h" to my -Prefix.pch-file.
Initialize the [GAI sharedInstance] in my AppDelegate.
I have attached screenshots of the setup in the bottom of this post.
When I try to build (either device or simulator, both 32bit), I get the following linker errors:
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_GAI", referenced from:
objc-class-ref in FTVAppDelegate.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
How do I solve this?
UPDATE 1
I also get the warning
ld: warning: ignoring file .../libGoogleAnalyticsServices.a, missing required architecture x86_64 in file .../libGoogleAnalyticsServices.a (3 slices)
ld: warning: ignoring file .../SDWebImage.framework/SDWebImage, missing required architecture x86_64 in file .../SDWebImage.framework/SDWebImage (3 slices)
UPDATE 2
This error only occurs when building for 64bit. I had accidentally set "Build Only for active architectures" to NO, when this changed to YES, I was able to build yet again. This means that the App now does NOT work on iPhone 5S - which is still a problem.
You're not doing anything wrong. I'm pretty sure google has not yet provided a arm64 version of their libGoogleAnalyticsServices.a, which is really annoying ...it has been weeks since the public the release of Xcode 5GM.
For now, I guess only build for armv7, armv7s or remove google analytics until they get their head out of their pants.
UDATE: Finally fixed https://developers.google.com/analytics/devguides/collection/ios/resources
Select this option in the Architecture section in "Build Settings" and your code will run on iPhone 5S, I had the same trouble.
Good news everyone, fixed by the 3.03 release:
64-bit support is now available in v3.03 of the Google Analytics
Services SDK for iOS. (Source)
I see on first screenshot that your project has 2 targets.
Are you sure that libGoogleAnalyticsServices.a added to both targets?
Linked frameworks may differ from target to target, so it's most common error this way...
Also try remove GA from project, then Clean, then Clean Build Folder, then restart Xcode and add GA again =) Yesterday this helped me =)

linker command failed with exit code 1 xcode4.5

I updated my iphone4s and xcode to the latest yesterday. And I'm trying to debug my app on my phone since my application uses hardware communication.
I'm using a third party library from Redpark(the company provides Dock to RS232 wire.)
While compiling, it gives an error
ld: file is universal (2 slices) but does not contain a(n) armv7s slice:/Users/...../libRscMgrUniv.a for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Does anyone know how to solve this except waiting for Redpark to update there library?
You can simply disable the compilation of armv7s in your Build Settings, by replacing the $VALID_ARCHITECTURES (which evaluates to armv7 armv7s now) value by the explicit value armv7.
Thus your application will only build for armv7 and not armv7s, so will not be fully optimized for the new iPhone5, but it will still run on iPhone 4 and 5 anyway (the armv7s processor of the iPhone 5 can execute armv7 applications, it is just not as optimized as with armv7s processor dedicated instructions)
I did another search and found two solutions work for me.
Dafna
1. Go to Target Setting -> Build Settings -> Build Active Architecture Only -> change to NO.
2. Still in Build Settings -> Valid Architecture -> delete armv7s.
They both work for me. If you have the same problem, definitely try this first.

Mach O Link Error- linker command failed with exit code 1 (use -v to see invocation)

When I try building for archiving for my app in Xcode (version 4.5) I get an error that says:
ld: file is universal (3 slices) but does not contain a(n) armv7s slice: /Users/[myrealname]/Downloads/[myappname]/BT_Objects/TwitterOAuth/SAOAuthTwitterEngine/libOAuth.a for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)
It then says under it:
(null): File is universal (3 slices) but does not contain a(n) armv7s slice: /Users/shakerite/Downloads/shakeritetestnotrealone_v15_iOS/BT_Objects/TwitterOAuth/SAOAuthTwitterEngine/libOAuth.a for architecture armv7s
Does anyone know how to solve this?
I received a very similar message just the other day when I tried running my app on my iPad after several successful attempts on the simulator. I found out that under the build settings I had to make "build active architecture only" to yes. Then my app would compile on my device. Hope this helps.
Yeah, I had this same exact problem. Click on your project in xcode. Then, click on the target. Go to build settings and look for valid architectures. Delete armv7s from the list of valid architectures and just leave armv7.
Let me know if you have any questions!
here I provide you one temporary solution that can solve this error hope its help you,
go to Project->Build Settings->Build Active Architecture Only->yes
thats it.

Xcode 4.5 Update (Project Error)

I updated Xcode and I ran into a project error:
clang: error: linker command failed with exit code 1 (use -v to see invocation)
and
ld: file is universal (3 slices) but does not contain a(n) armv7s slice: /Users/joe/Desktop/AdMob/libGoogleAdMobAds.a for architecture armv7s
This worked fine in the older version of Xcode, but not now. I know it has something to do with the file named: libGoogleAdMobAds.a
Which is used for AdMob ads...
Here is a screenshot:
UPDATE:
Check that you are using the latest AdMob SDK for iOS as that error implies the library doesn't have the iOS 6 added architecture (armv7s).
You can select
project settings->Build-settings->Compiler for C/C++/Objective C
select Apple LLVM Compiler 4.1
and build the projects

Resources