Make library support 32bit architecture and 64bit architecture ios - ios

I created a objective-c library in Xcode 6.1. It supports 64 bit architecture. I added it to an old project with 32 bit support. It is crashing and giving me an error
ld: file is universal (3 slices) but does not contain a(n) armv7s slice
How can i update the library to support the old project?

Remove the support for any architecture armv7s from the project (target) -> Build Settings -> Valid Architectures:
Alternatively, you can set the flag for your debug configuration's
Change Build Active Architecure Only to Yes.
Hope this will work.

you can just add armv7s to the library's Target->Build Settings->Architectures along with ($_ARCHS_STANDARD)

Related

armv7 not being added while creating static library

I'm creating a static library in iOS. When I check for architecture of library using the command
lipo -info {LibraryName}.a
I'm getting only arm64 as the architecture for library. I also need armv7 to be included for this library so that I can integrate it with another app and archive it.
In the Architectures I've selected Standard architectures
(armv7, arm64) - $(ARCHS_STANDARD)
And for Valid architectures I've arm64 armv7 armv7s
please help me.
Also check your iOS deployment target. If it's 12.1 for example it won't include armv7.
Make sure that Build Active Architecture Only is set to No. (This is under Build Settings in the Architectures group).
I had a similar problem and this seems to fix it.
(Now I just need to understand why armv7s is no longer included and if it matters...)
In addition to making sure Build Active Architectures Only is set to No, check the format of Valid Architectures. I have accidentally typed armv7, arm64 – notice the comma – on multiple occasions now, and it does not give you an error or warning. It simply builds arm64 by default. Correct it by removing the comma, like this: armv7 arm64.

XCode error when buiding for app store

Since the start of 2015 apple have new restrictions that say you must have 64-bit support and build with ios 8 SDK. I built my code with Unity for IOS, then opened XCode and opened the file I just created through Unity. I built it inside XCode fine with no errors. I then go to archive it and validate it. It then tells me about the new restrictions that I have mentioned above.
It says to use the default architecture to build a single binary. I go and change the architecture to suit this. Then I do a fresh build and it gives me an error saying "File is universal (2 slices) but does not contain a(n) armv7s slice". I researched this error and it said to just remove armv7s from the architecture. I did this and built again.
I then get the error "missing required architecture arm64 in file ..... undefined symbols for architecture arm64". I know this means that some of my libraries are not supported for arm64. I take out arm64 from architecture and then I am back to the start where it says I need to build for 64-bit.
Has anyone come across this type of problem before and may have a solution.
Many thanks in advance
You need to make a new build from Unity.From Player Settings -> Iphone -> Other settings -> Configuration . Under Scripting backend select IL2CPP and then under Architecture select Universal.

Error creating LLDB target at path, Xcode 6 GM seed,the screen stuck [duplicate]

I'm getting this error whenever I build in XCode 6 beta 4. It seems to be making my app insanely slow.
Warning: Error creating LLDB target at path
'/***/***/***/***.app'- using an empty LLDB target which
can cause slow memory reads from remote devices.
What exactly does this mean and how do I fix it?
Thanks in advance!
Did you use Architectures=$(ARCHS_STANDARD_32_BIT) and run your app on a 64 bit device? (iPhone 5S or iPhone 5S simulator)
Apple seems to be stricter with apps which don't support 64bit. So if there is no specific reason, I think it's better to include arm64 in your build architecture
NOTE ABOUT 64-BIT ARCHITECTURE
An app extension target must include the arm64 architecture in its Architectures build settings or it will be rejected by the App Store. Xcode includes this architecture with its “Standard architectures” setting when you create a new app extension target.
If your containing app target links to an embedded framework, the app must also include the arm64 architecture or it will be rejected by the App Store.
For more information about 64-bit development, see 64-Bit Transition Guide for Cocoa Touch or 64-Bit Transition Guide for Cocoa, depending on your target platform.
Source: https://developer.apple.com/library/content/documentation/General/Conceptual/ExtensibilityPG/ExtensionCreation.html#//apple_ref/doc/uid/TP40014214-CH5-SW1
This warning is solved by changing Build Settings :
Select Project -> Build Settings
Change 'Architectures' to 'Standard architectures (armv7, arm64) - $(ARCHS_STANDARD)'
This will prompt an alert stating iOS 5.1.1 and above are supported. Click 'Change Deployment Target to 5.1.1'
Repeat steps for Target (if not changed automatically)
Also, this is preferred build setting since Apple is forcing developers to build apps on 64 but architecture. Apple document Link
Double Check Build Settings => Valid Architectures for both Project and Target.
Mine used to say: arm64 armv7 i386 (The one causing the error was i386)
I replaced it to : arm64 armv7
I hope that helps.
In Xcode 6.4 , Swift 1.2. I had to edit both the Project and Target to the correct arm verisons (arm64, armv7 and armv7s). Take a look:
My "Architectures" included arm64 but I had to add arm64 to "Valid Architectures" in the target.
In my case I had to change Build Active Architecture Only to YES for the Debug configuration.

Getting Error : ld: file is universal (2 slices) but does not contain a(n) armv7 slice [duplicate]

I upgraded Xcode version and when using external static libraries, I get this message:
ld: file is universal (3 slices) but does not contain a(n) armv7s slice: /file/location for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Is there any way to bypass this and add support to the library if the developer of the library hasn't updated their library yet?
If you want to remove the support for any architecture, for example, ARMv7-s in your case, use menu 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 architecture from your main project, not from the library.
Alternatively, you can set the flag for your debug configuration's "Build Active Architecture Only" to Yes. Leave the release configuration's "Build Active Architecture Only" to No, just so you'll get a reminder before releasing that you ought to upgrade any third-party libraries you're using.
I've simply toggled "Build Active Architecture Only" to "Yes" in the target's build settings, and it's OK now!
Try to remove armv7s from project's "Valid architecture" to release from this issue for iOS 5.1 phone
I just posted a fix here that would also apply in this case - basically, you do a hex find-and-replace in your external library to make it think that it's ARMv7s code. You should be able to use lipo to break it into 3 static libraries, duplicate / modify the ARMv7 one, then use lipo again to assemble a new library for all 4 architectures.
Flurry Support for iPhone 5 (ARMv7s)
As I mentioned in yesterday’s post, Flurry started working on a version of the iOS SDK to support the ARMv7s processor in the new iPhone 5 immediately after the announcement on Wednesday.
I am happy to tell you that the work is done and the SDK is now available on the site.
use menu Project -> Build Settings ->
then remove armv7s from the"valid architectures".
If standard has been chosen then delete that and then add armv7.
In case this happens to someone. I built my own library to use with a third party code. While I was building it to deliver, I accidentally left my iPhone 4S plugged in, and so Xcode built my library only for the plugged architecture instead of following the project settings. Remove any plugged in devices and rebuilt the library, link it, and you should be all right.
Hope it helps.
In my case, I was linking to a third-party library that was a bit old (developed for iOS 6, on XCode 5 / iOS 7). Therefore, I had to update the third-party library, do a Clean and Build, and it now builds successfully.

Apple Match O-Linker Error when testing on iPad 4th gen

I'm using the Facebook iOS SDK the latest version, added AdSupport, Accounts and Social frameworks to my project along with the FacebookSDK framework. My project is targeted for iOS 5.1, works fine in the simulator, but when I try to test on my iPad 4th gen y get this:
ld: warning: directory not found for option '-L/Users/8vius/Projects/Work/Fonyk/Fonyk-iPhone/Fonyk/facebook-ios-sdk'
ld: warning: directory not found for option '-F/Users/8vius/Projects/Work/Fonyk/Fonyk-iPhone/../../Desktop/facebook-facebook-ios-sdk-6825350/build'
ld: file is universal (3 slices) but does not contain a(n) armv7s slice: /Users/8vius/Projects/Work/Fonyk/Fonyk-iPhone/Fonyk/libGoogleAnalytics.a for architecture armv7s
Any idea how I can fix this issue?
Ok, the problem is because the Facebook SDK isn't updated and doesn't match my current architecture for testing. To solve this issue go to Project -> Build Settings and change the valid architectures to armv7 for Release, Ad-Hoc and Debug (or just for the one you need right now). and set Build Active Architecture Only to No

Resources