So I just recently updated Xcode to 4.5 and was able to get my hands on a iOS6 phone. I was doing testing on the simulators fine (4.3/5.1/6.0) but when i decided to build on the actual iOS 6 phone it gave me this error.
No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=armv7s, VALID_ARCHS=armv6 armv7 i386).
I did some lookup and fixed it by going into build settings to change the valid architectures to include armv7s and it did what it was suppose to do.
HOWEVER by adding that I got this error
ld: file is universal (3 slices) but does not contain a(n) armv7s slice: some static library framework for architecture armv7s
After some looking it feels to me the static library framework is causing all the problems since it doesn't support iOS 6 and I'm not too optimistic that it can be fixed easily. However since I couldn't fine my exact situation on the net I'm hoping there's someone who knows this better than me and can help me. Thanks
Note: that static library is everywhere in the code, removing it is pretty much not an option
You can try to change "Build Active Architecture Only" YES --> NO. Works well for me.
In order to build, all the static libraries an application links against must generate code for all of the application's architectures.
It looks like Xcode 4.5 has updated your project to build armv7s code, but it neglected to add armv7s to the application's active architectures.
Once you fixed that, it looks like the problem is that the static library is not producing armv7s code, but your application is trying to build for armv7s.
If that's the problem, there are two ways to fix this. Either you want your application to only generate armv7 code (removing the need for armv7s code), for which you'll need to change your application's target settings to:
... or you want your application and all linked static libraries to have build settings that look like this:
armv7 code will run on anything from the 3gs upwards. armv7s code will run on the iPhone 5 only, and will be slightly faster.
So if you have access to an iPhone 5 to test on, and you have the source code to the static library then the second option is probably best. Otherwise, assuming that your library is at least generating armv7 code, then as long as your application isn't trying to build armv7s you should also be fine.
If the library is only building armv6 code, which isn't supported by xCode 4.5, then you'll need to change its build settings to produce at least armv7 code.
Xcode 4.5 doesn't support armv6 anymore, so you need to remove this architecture.
As you already found out, the library you use doesn't seem to support armv7, which now is essential.
I think there is no alternative to compiling the library with the correct target. If you have the source code, this should be trivial; if it's third party, you depend on them to update. They will know, however, that without updating their library has reached end of life.
I has similar problem. Got it solved by changing 'Build active Architecture Only' to 'NO' in Build settings of Target Project.
Remove armv7s and add armv7 (and/or armv6)
Related
So, I'm creating a jailbreak app and I'm trying to use libMobileGestalt.dylib in the app. I link the file correctly and add the header and call MGCopyAnswer. The problem is, I get this error:
Undefined symbols for architectures armv7: "_MGCopyAnswer", referenced from:
This error only occurs when the app is built with armv7 architecture. It doesn't occur when arm64 architecture is used. I know that this occurs due to the dylib being built with the arm64 architecture, but I really want it to work with the armv7 architecture so that the app would be compatible with a larger range of devices.
Is there a place from which I can obtain the armv7 architecture version of the dylib, or be able to build it again with that architecture included? Is there any solution to this that anyone knows? Thank you for helping in advance.
you have to import libMobileGestalt
under target
then Build Phases
and Link Binary With Libraries
then added new Binary
when you see search field
type " libMobileGestalt.dylib "
and then Add
I found out the solution. The reason I was getting an error was that I was linking that dylib to a static library I was creating, which isn't possible, so I had to also link this dylib to all the projects I created that use the static library (which in turn uses the dynamic library). Hope this makes sense :P And thank you all for trying to help :)
I am trying to build my static code analysis configuration for iOS through Jenkins. I am Using Architecture - $(ARCHS_STANDARD_32_BIT) and valid architecture - arm64 armv7 armv7s.
While trying to build the configuration I am receiving the error message
**Check dependencies
No architectures to compile for (ARCHS=i386, VALID_ARCHS=armv7 armv7s).
** BUILD FAILED **
Also I tried with armv6 and other architecture , But I am receiving the same error.
I am facing this issue for the code developed for iOS7 and I am using Xcode 5.0.2.
Kindly help me to resolve this issue.
Thanks In Advance !
try to check deployment target -> IPHONEOS_DEPLOYMENT_TARGET
Change it to something higher when 3.0 is selected. for your architectures probably iOS 7.0 would be suitable.
I solve this issue with this settings.
Choose project workspace, in xcode choose General tab, Deployment Info section, change Deployment Target to 7.0
You can also change it in Build Settings tab in Deployment section of your project. Field name is iOS Deployment Target
If you are using some versioning system don't forget to commit (and push) changes(like me...)
Under the Build Active Architectures Only setting, change Debug to NO
You're trying to build i386 (ARCHS=i386), but you've also told it that only armv7 and armv7s are valid architecures (VALID_ARCHS=armv7 armv7s). Add i386 to the list of valid archs.
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.
I was using ZBar for scanning in iOS5 and it was working well.
Now after updating to iOS6, its not working. It shows a following error.
ld: file is universal (3 slices) but does not contain a(n) armv7s slice: /Users/mac4/Desktop/my desktop/My app/MyApp name 20:09:12 /MyApp name/ZBarSDK/libzbar.a for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)
What is wrong in my side?
In Xcode, go to the settings of your target,
change 'Valid Architectures'
from
armv7,armv7s
to
armv7
This change means your app will not take advantage of possible optimizations the new iPhone5 processor has, but you don't have to wait for 3rd party libraries to upgrade or mess with a hex editor.
i recently faced the same issue. The problem seems to be that the ZBar SDK is not ready for the armv7s architecture.
I solved the problem this way:
Go to the ZBar homepage and navigate to the mercurial repository (direct link)
Download the zbar repository as zip.
Unzip the file and navigate to the subfolder named "iphone".
Open the XCode project.
Delete the "Examples" folder (the folder caused a build error on my machine).
Hit "CMD + B" and build the source.
Find your new libzbar.a file. (User/Library/Developer/Xcode/DerivedData/zbar...)
Replace the old libzbar.a file in your project with the new one.
Hit "CMD + R" and you are good to go.
The hg sources download/re-compilation tutorial is great, but you don't need to do all that.
Just browse to http://sourceforge.net/projects/zbar/files/iPhoneSDK/beta/ and download ZBarSDK-1.3.1.dmg, and everything will work out of the box for the latest architectures (in my case armv7, armv7s).
Update:
Some of you reported issues with ZBarSDK on XCode 5, iOS 7 or architectures arm64... well I went back to this project today and experienced similar issues and found that there is a ZBarSDK library that is compiled to work with iOS 7 at: http://www.nerdvision.net/app-development/ios/zbar-sdk. I Just replaced the old files with the new ones and my project compiled. Note that the Architectures in my project's Build Settings are set to amrv7, arm64 ($ARCHS_STANDARD), Base SDK is set to iOS 8.0 and I have the Build Active Architectures Only flag set to Yes.
There is a question here at SO about this: zbar SDK dont work for armv7s(iPad 4 iOS 7)
Thanks to #cdescours for the tip!
I have same problem but I just added armv6 and armv7 then it works for iOS6. Just insert armv6.
your binary library does not have code for armv7s. So you should recompile it for the current archtitectures.
Recompile the source, I download the source code for zbar and compile into new project. It's simple.
Clone the Mercurial repository and build with Xcode. It's very easy. Here's a link to the repository:
http://zbar.hg.sourceforge.net/hgweb/zbar/iphone/summary
Came here with the same problem after downloading the tutorial code RDC provided in his blog. Very useful post, but the most helpful answer here was posted by RacZo on 3/29. I just downloaded the original ZBarSDK-1.3.1.dmg image, removed the ZBarSDK from my project and replaced with the original. Done.
I am learning IOS development. After few days digging,
Here is the tutorial for installing ZBar SDK.
1, The accepted answer is correct, but with some limitations. (tried, works!)
2, The alternative solution is here. (tried, works!)
3, The best is to build the all different architectures separated then bind them using lipo: Great Solution (tried, brilliant!)
Some readings for understanding those architectures:
http://wanderingcoder.net/2010/07/19/ought-arm/
http://wanderingcoder.net/2011/09/25/compiling-armv7/
I am about to upload my very first app and I changed the deployment target 30 ios 3.0 and I am getting a warning that I have no idea what to with. If anyone could help me out, it would be much appreciated since I am basically done! (I hope). Its talking about some arv6 architectures and I don't know what that means.
Thanks!
[BWARN]warning: iPhone apps with a deployment target lower than 4.3
should include an armv6 architecture (current
IPHONEOS_DEPLOYMENT_TARGET = "3.0", ARCHS = "armv7").
warning: iPhone/iPod Touch: application executable is missing a
required architecture. At least one of the following architecture(s)
must be present: armv6 (-19033)
In your project -> build settings -> architectures, try adding an arm6 architecture
See this answer, it has a step by step process of how to add an architecture
"Warning: iPhone apps should include an armv6 architecture" even with build config set
Better question - why do you feel you need to support iOS3.x?
At this point you should switch to ARC and support only 4.x devices or greater, unless there is an absolutely compelling need. Remember that percentage wise only a tiny number of devices at this point are restricted to iOS3.