linker command failed with exit code 1 xcode4.5 - ios

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.

Related

Flutter build is iOs - Error (Xcode): Undefined symbol: _objc_msgSend$

Trying for several days to build my flutter project in iOs (flutter build IPA) and I always seem to receive the same errors :
"_objc_msgSend$setIOSHasWarnedLocationServicesOff:", referenced from:
+[LocationAuthorization run:onCancel:] in TSLocationManager(LocationAuthorization.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
There are a lot of them so I won't be putting all of them here but they're all related to _objc_msgSend$ and TSLocationManager.
I tried to add "-lc++" to Other Linker Flags in Build Settings (Runner Target)., related to this issue https://github.com/facebookarchive/pop/issues/25 but it still failing with more than 100 _objc_msgSend$ issues. I have frankly tried so many things and I'm quite out of clues.
Something I remarked is that when I build from Xcode (Product -» Build), it builds fine when I choose the Destination Device iPhone SE 3rd GEN, but I get the errors when the destination device into my physical device (which is plugged into my Mac).
When I hit flutter build IPA, it always fails.
^_^
First you can update your xcode to version14.0 above.
And the real reason is Apple Clang new optimization scheme._objc_msgSend stup support is not support on xcode13.
If you don't want upgrade your xcode version . You can follow next steps to change your private framework.
I guess you compiled a framework in xcode14 and then used it in xcode13
hh , now i saw you reply , make sure my answer
i'm using Xcode 13.4.1 and it's not having ARCHS_VALID as a build setting #editix –
Bertrand Gélinas
22 hours ago
By default, the clang in Xcode 14 will generate target files that cannot be understood by earlier native linkers.
In the future, it will be recommended to use Xcode14 and above for application package.
If you have private framework build by Xcode14.
Just add -fno-objc-msgsend-selector-stubs to your framework project target build settings other c flags, and build again, replace new framework to your other xcode project
or in your framework project chaneg your podspec file add xcconfig other c flags -fno-objc-msgsend-selector-stubs
or your own script build framework , you can before call xcodebuild command add a change , like thisxcodebuild -project xxx.xcodeproj build OTHER_CFLAGS="-fno-objc-msgsend-selector-stubs "
click on your target > build settings > VALID_ARCHS > and add the following :
arm64 arm64e armv7 armv7s x86_64
in case you didn't find the VALID_ARCHS do the following:
1- Click on the plus sign under the Build Settings.
2- Choose "Add user-defined settings" and it will add NEW_SETTING to you.
3- Rename the "NEW_SETTING" to "VALID_ARCHS" and add the following builds:
arm64 arm64e armv7 armv7s x86_64
if nothing fixed your issue please follow this you may find working answer:
Undefined symbols for architecture arm64

"Missing required architecture arm64 in file..."Xcode 6 beta when running in ios 7 device

Im currently making a project in swift and its going allright..
But when I run my app on my device (iPhone 5s -iOS 7.1), XCode returns me the following error
ld: in '/usr/lib/system/libsystem_configuration.dylib', missing required architecture arm64
in file /usr/lib/system/libsystem_configuration.dylib (2 slices) for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I have tried removing derived data but it didn't work and I couldn't find any other answers to that question.
EDIT: Running on simulator with iOS 7 (both 32bit and 64bit sims) works flawlessly.
Do u have this architecture type with you under architectures.Sry had to add image so created a post .
Also did u try setting Build Active architectore only to NO .
Is the arm64 architecture required in ur project?... if u dont need it please check this SO link to edit the architectures.Click this link

Xcode : Apple Mach-O linker Error

I made the app in Xcode 4.6 and tested in device. The app is made for both iPhone and iPad. When I try to archive it to make .ipa file, I get this error :
ld: file is universal (3 slices) but does not contain a(n) armv7s slice: /Users/admin/Desktop/appName/appName/libzbar.a for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)
How to set the architecture for this in Build Settings? Or is there some different issue?
libzbar.a library needs to be built for armv7s architecture. If you cannot do that (because you don't have source code for this library) than you should remove armv7s from valid architectures.
You can change valid architectures by following steps:
select project name from the Project Navigator
select project target
open Build Settings tab
change valid architectures field

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.

Apple Mach-O Linker Error armv7s & libGoogleAdMobAds.a

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/

Resources