Cannot build to 4.2.1 device with Xcode 4.2 - iphone

I recently upgraded my project from Xcode 4.0.1 to Xcode 4.2 - and everything went pretty smoothly, I did some debugging in the simulator and then I decided to build with device.
My device is a 2nd gen iPod Touch running 4.2.1, so I initially attempted to build to it and got this error:
An unknown error message 'IncorrectArchitecture', was received from the device.
As you do with most error messages, I googled it, and found this question.
After reading the answer, I proceeded to check up on my target architectures, and it turns out I only had armv7 as an architecture to build for. - I added the armv6 architecture, as the answer suggests, but when I built it, I got a load of build warnings/errors such as:
ignoring file /some/path/to/a/staticlibrary.a, file was built for archive which is not the architecture being linked (armv6)
This occurs on all the static libraries in my project, such as the kal library - libkal.a and all the three20 libraries.
Those libraries linked fine in Xcode 4.0.2 - and it also built fine to my iPod - so why will the armv7 architecture not build AND the libraries not link for armv6 in Xcode 4.2? - I'm really confused - any suggestions would be greatly appreciated.

Add ARMV6 to your build settings like this:
Select your build settings
Scroll to Architectures
Doubletap on the existing entry
Tap on +
Enter armv6
Tap on Done
You will need to do this for all projects that are linked with your app (e.g. three20).

Related

(null): iPad: application executable contains unsupported architecture(s): armv7s (-19031)

When I build my iphone app and my ipad app for archiving, I get this message: (But with iPhone instead of iPad in the iPhone app ofc)
(null): iPad: application executable contains unsupported architecture(s): armv7s (-19031)
I didn't get this error before! I didn't get it for my free versions of my app (which is almost the same code) I think it has something to do with iPhone 5? I want it to work with iPhone 5 so I don't want to remove it armv7s
/A noob
This warning is perfectly normal when you use an armv7 device to archive your application.
Think about it, you make an archive that includes the armv7s architecture (which is what we want) and the warning tells you that your armv7 device does not support that architecture (which totally makes sense).
To prove that even further, just hook up an iPhone 5 and try archiving and you will see that the warning will go away.
You have to wait until all custom libs in your project will update. Check it, some of popular libs have updated yet.
Until that remove armv7s:
Project -> Build Settings -> Archetecures
I had a similar problem on the XCode 4.6.3.
I get message:
iPhone/iPod: application executable contains unsupported architecture(s): i386
it turned out that if before the Build, run an application on the simulator, the application is going to the architecture i386 (for Mac), ignoring the Project Settings. Before Build need choose iOS Device as target.

xcode validation error : application executable is missing a required architecture

our clients also reported same error that discussed here:CLICK HERE . None of the solution in that fixed my problem…may be I did in wrong place... ……………..
Error : iPhone/iPod Touch: application executable is missing a required architecture. At least on of the following architexture(s) must be present: armv6 …………
Help me to set right settings in plist and Xcode target. OS supported iOS 4.3 and above and device both iPhone/iPad/iPod.
Here is sample Xcode project: http://po.st/0fc5AU
Please updated this sample and send me. I tried a lot but confused with all solution...again reported same bug.
Add
armv6 armv7
to the Architectures and Valid Architectures build settings of your target.
PS: if you're using cocos2d v2.x this won't work, it doesn't work with armv6 devices since they only support OpenGL ES 2.0.

iPhone Compiler Fails: No architectures to compile for

I'm trying to implement the Cocoa plotting framework (Alpha Release 0.1) in my iPhone app.
I figured I'd first try to run the sample they provide. I attempted to open and compile the project located in /Source/examples/CPTestApp-iPhone/.
It says my base SDK was missing right off of the bat, so I edited the Project settings and the Active Target to use the iOS4 SDK, which I've done before for samples and had work. I'm not sure what to do. I'm running one of the newest Unibody Macbooks, with 10.6.4.
Here is the full error:
// - start - //
Check dependencies
[BEROR]No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=i386, VALID_ARCHS=armv6 armv7).
// - end - //
Thoughts?
I also went to the Build settings for the target(s) that failed and added "i386" to the valid architectures
Try this:
Project Build Settings:
Architectures: Standard (armv6 armv7)
Base SDK: Latest iOS Build Active
Architectures Only: Checked Valid
Architectures: armv6 armv7
Delete any sub settings in the Architecture build setting.
Target Build Settings:
Same at project settings.
Frameworks
Add the SystemConfiguration.framework to your project. - Not sure why this had any impact.
Clean all targets.
Build for the simulator.
The long explanation for this can be found on our blog: http://longweekendmobile.com/2010/06/15/fixing-the-missing-required-architecture-arm-in-file-when-developing-for-ipad/
Adding i386 to the Valid Architectures list worked for me!
For me it was that I had to add i386 to the VALID_ARCHS list. Odd, but it fixed my problem for simulator builds.
See this post.
You have selected as active architecture "active arch=i386 (your Mac)" but the project compiles for " VALID_ARCHS=armv6 armv7 (iPhone Device)", try setting the right arch in the project settings, so it is built for iPhone as it should be.
This project appears to pre-date iOS 4, so you need to open up the .xcodeproj file for the Core Plot library itself, too. It probably also has a broken reference to an old iOS Base SDK and may need the architectures updated.
This happens all the time with old projects migrated to SDK 3.2/4.0. You have to open the target settings and change everything to SDK 4.0 or 3.2. You can still have the target OS be 3.0 if you want that. If it still says "missing SDK" you neglected to change one of those settings to 4.0 or 3.2.
armv6 armv7 , Works for me in valid Architecture .
If you tried all method with "NO SUCCESS"
Try to run project on you device, if it works on device then it will works fine on simulator too.

Xcode vs. static library vs. armv6

I have a home-rolled static library to which I link my iPhone app. Works great in Debug mode for Simulator, armv7 (iPhone 4), and even in my unit test app in OS X (GHUnit). However, when I try to run debug my app on my iPhone 3G with iOS 3.0, no dice. The app dies in runtime when it tries to access my library classes.
Both the app & library have
Architectures: Standard (armv6 armv7)
Valid Architectures: armv6 armv7 i386
I'm linking with "-ObjC -all_load", and I've seen some indications that -all_load can cause problems with fat binaries. Yet the armv7 version is working fine. Anybody know what's going on here? Is there a magic build incantation I'm missing?
This is quite similar to Static library dependency compiles in simulator on Xcode 3.2.3, fails on device. The halfway answer is that -all_load is causing the problem when targeting more than one architecture. The jury is still out on the definitive solution.

How to make Xcode 3.2.3 build a specfic architecture?

I'm getting the following error when including static libraries:
missing required architecture i386 in
file
This worked 30 seconds previously, and only failed when I upgraded to Xcode 3.2.3. I've used "file" command to check - and, yes, XCode is building completely the wrong architecture (armv6 + armv7 instead of i386).
This seems to be a major bug in latest Xcode, where Apple has re-written the build / compile / link settings. There's a note in the release notes saying very vaguely that they've "Changed it" because it used to be "confusing". This is not helpful.
The build settings for the library VERY clearly say:
"Valid architectures: i386"
There's no confusion here - Xcode is building something other than what the target says it should.
The question is: how do you un-break this? How do you force Xcode to do what it's supposed to? I've re-installed Xcode from scratch, cleaned everything, and manually inspected the build files. There's nothing wrong (and, of course, it worked perfectly in xcode 3.2.2)
After considerable research, I believe the answer is:
"this is now impossible - Apple has deliberately hard-coded XCode to ignore build settings"
However, I've come up with a script that automatically builds ALL platforms of a project (which you HAVE to do with static libraries - you don't have much choice now, because Apple has disabled Targets), and the script could easily be modified to do all targets, instead of all platforms:
Build fat static library (device + simulator) using Xcode and SDK 4+
Right click on your Target app under Targets and make sure that the Base SDK is set to iOS.