How to add armv6 architecture to Xcode project? - iphone

I got a warning that my project needs to include the armv6 binary.. but I don't really know how to do that. Have been googling for an answer, but non of the suggestions seems to fit?
Is armv6 something I need to download to support in my app, or does Xcode have it, I just need to include it in my project settings?
Also, my app should support OS back till 3.1.
I have added i386 behind armv6 and armv7 in the Debug section, but I dunno if that fixes the problem. Does this seem right to you people with more experience?

Follow my step
In your picture you choose level change it to "Combined"
Click at Standard (armv7) $(ARCHS_STANDARD_32_BIT)
Choose "Other"
CLick at "$(ARCHS_STANDARD_32_BIT)" and the Click "-" to delete it
Click "+" to add new item
Type "armv6"
Click "+" again
Type "armv7"
Click anywhere to finish
I hope this help
I just have the same problem and I try to do this and it work for me

I could run my code on an old 1st generation iPhone using the string armv6 armv7 instead of $(ARCHS_STANDARD_32_BIT) in architectures and setting "Build Active Architecture Only" to YES.

In Project Settings, select "Standard" for the architecture (not "Optimized"). This should allow you to select "armv6" for the Active Architecture. This means it should also work on older devices (barring any other deprecations) once it's on the app store.
Change your base SDK to iOS Device 4.x or below so you can see your armv6 architecture.

I just had this same problem. I loaded up a number of older XCode projects and they would compile and run fine with the simulator however as soon as you tried to run or debug on the device (which in my case in a iTouch v2) it would simply say it was running, then say the application exited. No errors, no logs.
Thanks to someone on the iOS Developer forums for putting me on the right track. At some point over the last couple of XCode releases (not counting the XCode releases for OSX Lion as I have access only to OSX Snow Leopard) Apple changed how projects were set up even older ones that were loaded.
The standard architecture used to include both arm6 and arm7 however, and at least with XCode 4.2 standard now only includes Arm 7 $(ARCHS_STANDARD_32_BIT) and apparently resets an old project's settings as well. Which went un-noticed to me as I used the simulator.
I tried changing the configuration string to "arm6 arm7" and this did not work. However the error that was returned contained the solution (at least for me an hopefully others still having this problem.)
In XCode 4.2 if you wish to build down to older hardware such as v1 and v2 devices simply change the project setting for Architectures to $(VALID_ARCHS) which defaults to the old standard of Arm6 and Arm7.
You may as mentioned previously be required to set the Build Active Architecture Only to "Yes" for the debug option (this however is not confirmed by me to be required).
I hope this helps anyone else still having this issue and I apologize for bumping this thread.

That's because you use the new iOS 5 SDK. Apple drop the armv6 architecture from the standard architectures.
You can have more information on this thread I've started before.

Related

Alert from os: app may slow down your iPhone

Hy,
I have uploaded the app to App Store with both architecture. Please see the attached image for Build Settings of TARGETS in Architectures. And luckily it get Ready for sale, but iPhone 5s giving alert.
The alert is: "APP" may slow down your iPhone. The developer of this app needs to update it to improve its compatibility.
I googled but do not found solution to get rid off this alert. On other hand i also need to support iPhone5 and prior (32 bit architectures). Please help.
The problem is that Build Active Architecture Only, as shown in your screen shot, is set to Yes. This means that you are not building an app that contains both 32-bit and 64-bit architectures; you are only building for one architecture. And from what you say, that architecture must have been the 32-bit architecture.
Problem :- This issue is because you are supporting 32bit architecture
Solution :- armv7 is 32 bit processor, u might have to remove that
from architectures list
Here is the list of processors and their architectures
iPhone 5S has 64bit processor, so removing armv7 will not have any impact for iPhone 5S you can find the list of devices and their configuration in this link
What fixed this for me was going into TARGET > 'Build Settings' and then under 'Valid Architectures' I added arm64 to the two that were already there, armv7 and armv7s. Also, ensure 'Build Active Architecture Only' is set to no.
Check if you have 'Architecture Priority' LSArchitecturePriority in your Info.plist. I had Intel (32-bit) for some unknown reason. Deleting this key solved the issue for me.
Get the .IPA file which you had uploaded and Change the extension to .Zip and Unzip the file
And open the terminal and execute the below command,
file ~/SOME_PATH/Payload/.app/
you'll get the architecture details for the IPA
In Addition,
main cause for this problem is below ways to look out
Your iOS app is not up to date of iOS device version/apple guidelines
If your app containing outdated libs
If your app is 32 bit Arc family and trying to run in 64 bit arch iOS OS

Why I can not find my Iphone device in xcode

I have added my iphone as device and associate it with provisioning. Then I download the newest provisioning and install it (I have successed added ipad as test device before).
Now, in the "Organizer", I can see the iphone device but when I connect iphone device I can not find the iphone device to run my app. My software version is 4.2.1, is it the version not the latest that lead to this problem? Or what is the possible reason?
Yes, the software version of the iPhone matters. It has to be within the range of the minimum deployment target outlined in your project. So:
If you pull up your "project" settings (click on the top most folder at the root of the list of all of the source files tree structure in the project navigator panel on the left, then in the main panel click on your project name underneath "PROJECT" and the select the "Info" tab, there's something there that says "iOS Deployment Target". If that iOS version is greater than the iOS version of your device, you won't see the device listed in Xcode's schemes (where you select devices v simulators). By the way, it's ok if your app's "base SDK" is a higher number (just make sure you don't use any iOS 5-only method, or if you do, make sure your program programmatically tests for the existence/support of those methods), just make sure the deployment target is low enough for your device. Anyway, if you change the "iOS Deployment Target", your device should show up. (Also, by the way, if you altered your target's minimum deployment (i.e. if you ever changed it so it no longer defaults to the project's minimum "iOS Deployment Target"), you might have to tweak that setting, too.)
Also, if your iOS version is 4.2.1, I wonder if you're dealing with an iPhone 3G (the model before the 3GS). I say that because 4.2.1 is the maximum iOS version on that old hardware. Anyway, if this is the case, you should understand that the iPhone 3G and early iPod touches use the ARMV6 processor, rather than the ARMV7 processor. So even if you change the "iOS Deployment Target" to iOS 4.0, for example, you'll see your iPhone 3G show up on the list of devices for which you can build, but it won't work (and it won't give you any meaningful error message). This is only a concern if you're dealing with the 3G or earlier. To support those older devices (if this is a concern), in addition to the "iOS Deployment Target" setting discussed above, you also have to go to the "Build Settings" tab, find the "Architectures" entry, and make sure you add "armv6" as another option (click on the value next to "Architectures" (it might say something like "Standard (armv7) - $(ARCHS_STANDARD_32_BIT)", click on "Other...", and when you get the dialog box, click on "+" and add "armv6" (without quotes) as an acceptable value.
Once you do this, you may want to click on the button about "Validate Settings", because there's a cpu related fix that it suggests. Don't know if you need it, but I let it fix my project.
Finally, you will want to go back to your Project Navigator panel on the left (where you see all of your source files), find your app's plist (easiest to just type "plist" in the search box in the bottom left corner underneath the files), and go to the "Required device capabilities". Expand that list and if you see armv7 there, just get rid of the armv7 entry.
Points 2-4 are only required if you need to support older hardware, but this is unnecessarily complicated and unintuitive. Hopefully this helps.

iOS - file was built for archive which is not the architecture being linked (i386)

I got a few static libraries I want to use in my iphone app. When I try to run the simulator I get linking errrors.
I am new to iOS development, and I ran into this problem when linking against libraries I built previously;
file was built for archive which is not the architecture being linked (i386)
Which means all the functions I reference from those libraries gives me this:
undefined symbols for architectyre i386
I am not sure what to configure to make this right. The static libraries are build for armv7, supporteed platforms armv6 armv7.
I sorted a very similar error with a static library I was building for iPad. I believe my solution was to add "i386" to the Architectures setting for the project (Click on the Project -> Build Settings -> Architectures --or was it Valid Architectures?-- and click the '+' icon, type "i386" in the highlighted line). Anywho that should get you close.
Oh, one more caveat, I've read that we should set "Build Active Architecture Only" to "No" as well. It was already set for me, but that's something you might want to check.
After struggling with this same problem and following all the accepted answers of updating build settings, clearing the linker search path, etc.. I finally discovered an answer that worked for me.
Before building, make sure you select right type (iPhone Simulator) instead of iOS Device. Then rebuild. Otherwise, you're trying to use a library built for an iOS device (arm processor) on a simulator (i386). Should've been obvious, but wasn't.
Before:
After:
Now, look in the Products group in the Navigator > right click your static library (.a file) > Show in Finder, you'll notice that its in a Debug-iphonesimulator folder instead of Debug-iphoneos. I didn't pay any attention to the folder name originally, or I might have thought of this sooner.
Hope this helps.

XCode 4.2 compiling for iPhone 3g (armv6) [duplicate]

It's been a while since I've had to adjust project build settings. After upgrading to a recent SDK I'm having trouble building my ad hoc distribution configuration.
Build generates this warning and error:
warning: iPhone apps should include an armv6 architecture (current
ARCHS = "armv7")
iPhone/iPod Touch: application executable is missing a required
architecture. At least one of the following architecture(s) must be
present: armv6 (-19033)
However in my project I thought I had things set correctly:
Architectures is: Standard (armv6 armv7)
Base SDK: Latest iOS (currently set to iOS 4.2)
Valid Architectures: armv6 armv7
I have cleaned all targets.
I appreciate any tips.
If using Xcode 4.2 or higher, try the following:
Click your Project name (in the left column), followed by the Target:
Click the 'Build Settings' tab (in the right column):
Click the 'Release' or 'Distribution' row under 'Architectures', and choose 'Other...':
Double click the highlighted row named '$(ARCHS_STANDARD_32_BIT)' in the popover that appears, and replace it by typing 'armv6'. Then add a new row with the plus button in the bottom left of the popover, and type 'armv7', then click Done:
Update: you should add armv7s to target the iPhone 5 as well. (And drop armv6 if building with Xcode 4.5 or higher, which no longer supports armv6.)
That's it. You should now be able to build/archive without generating errors.
If it still doesn't work, see this answer from justinxreese, which suggests adding entries for armv6 and armv7 under "Required Device Capabilities" in your info.plist file.
If you uncheck "Build Active Architecture Only", then it will build all the valid architectures.
Update: This is no longer applicable as of Xcode 4 - follow Nick's instructions for Xcode 4 and later.
I had this problem even after following the accepted answer and found the following to work:
In your Info.plist, add an entry for Required Device Capabilities. This should be an array and will have two entries.
Item 0 : armv6
Item 1 : armv7
It will look like this:
In addition to Nick's answer about Xcode 4.2, you may also need to review your info.plist file. It seems as if new projects started in Xcode 4.2 by default specify 'armv7' in the 'Required Device Capabilities'. You'll need to remove this if wanting to support devices that run armv6 (e.g. the iPhone 3G).
Delete armv7 from the 'Required device capabilities' in yourProjectName-Info.plist
An ios 6 update
Changes in Xcode 4.5.x for ios 6
Xcode 4.5.x (and later) does not support generating armv6 binaries.
Now includes iPhone 5/armv7s support.
The minimum supported deployment target with Xcode 4.5.x or later is iOS 4.3.
I had this problem too. I just set my deployment target to 4.3 and left only armv7 architecture and it worked. At point almost everyone has 5, so 4.3 is fine.
for me it not work with every answer. but I try TARGETS > Architectures > Debug and add a new row with the plus button, and type 'armv6'(with out '), then click Done.
and finally CMD+B and then right click at PrjectName.app(in Products folder) > Open in Finder > Compress "PROJECT_NAME.APP" (in Debug-iphoneos) > Upload to AppStore
it's my screen setting.
if you have include project please config it all.
Hope your help.
After trying a mixture of these answers, I finally stumbled across making it work. Im so pissed off at Apple right now. Just another hour they made me waste. Here is my config.
I tried all the answers above ,none resolved my question. So I create a new project and diff the build settings one by one. Only "Alternate Permissions Files" is different.
The project build failed has a value armv7. Delete it then clean->build->archive . Succeed!
Hope can solve you question
Wow, I update/submit apps about every 6 months. Every time I do this I have to learn the "new" way to do it...
Same problems as described above when running iOS 5.1, and Xcode 4.3.2
Thanks for the posts! I spent a while updating all of the project settings to armv6, armv7, but no joy. When I set "build active architecture only" to No I got a build error about putting both objects in the same directory.
Fortunately, I noticed you guys were modifying the target build settings instead. This is what finally worked (armv6, armv7, and setting "build active architecture only" to No under the Target build Settings). As a disclaimer, I had already set all of the architectures to armv6, armv7 in the project settings too.
Anyway, thanks for the help,
Brent
I had to be sure to change these settings in both the Target and Project settings on xCode 4.3.2 after doing that and setting it to build for both armv6 and armv7 everywhere I was able to submit my app.
For safe measure I also exited xCode between making the changes and doing a clean, build, archive cycle.
Quite a painful problem for me too. Just spent about an hour trying to build and re-build - no joy. In the end I had to do this:
Upgrade the base SDK to the latest ( in my case iOS 5 )
Restart xCode
Clean & Build
It worked!
I guess it's a bunch of jargon about arm6 , arm7 as it looked like my project was valid for both, at least the settings seemed to say so ) , my guess is this is a cynical way to bamboozle us with the technicalities, which we don't understand, so we just take the easy option and target the latest iOS ( good for Apple with more people being up-to-date ) ....
Here is Apple's documentation:
Technical Q&A QA1760
It says there are two things that you must get right:
Add armv6 to the Architecture build settings
Set Build Active Architecture Only to No.
If this still doesn't help you, double check that you are really changing the architecture build settings for the right build configuration – I wasted half an hour fiddling with the wrong one and wondering why it didn't work...
Select Edit Scheme... in the Product menu, click the "Archive" scheme in the left list and check the Build Configuration. Change the value if it was not what you expected.
Note; I had to perform these steps for both my base project, and the embedded PhoneGap .xcodeproj file in my application.
Yes, I embed PhoneGap; they update far to frequently, and I've got less than two months to know that a feature is depreciated.
Try changing your deployment target to something higher than an armv6 processor. The settings for xCode are referencing the operating system level, for instance: iOS version#{3.1, 3.2, 4.0, 4.1, 4.2, 4.3, 5.0, 5.1}
(i)You can set this in the build settings tab or the summary tab. Start at the top left of the window in the Project Navigator, with all the files listed in it. Click the top-most one which has a blue icon.
(ii)If you are planning on using the programmable shader line circuitry, which is accessed and controlled through openGL ES 2.0 API, then you should set your "Deployment Version" to about 4.3, which I believe is only available on devices such as the 3GS or newer. xCode is reporting that iOS 4.2.5 or higher is needed run armv7 code. And once again, this processor, I believe, started with the 3GS.* iOS 4.3 seems to be the choice for me, for now.
http://theiphonewiki.com/wiki/index.php?title=Armv7
http://en.wikipedia.org/wiki/List_of_iOS_devices
If xCode keep complaining about armv7, make sure you disconnect any connect device (especially iPhone 5!!) and try again. Took me hours to find out that little piece of information.
Using Xcode 4.2 on Snow Leopard, I used the following settings to build an app that worked on both armv6 (Iphone 3G and lower) AND armv7 (everything newer than 3G including 3GS).
architectures: armv6 and armv7 (removed $(ARCHS_STANDARD_32_BIT))
build active architecture only: no required device capabilities:
armv6
do not put armv7 in required device capabilities if you want the app to run on 3G and lower as well.

Adding SDK-specific frameworks to Xcode

Xcode 3.2 kind of broke the build process of my iPhone app. I need to add a new framework to my project (MediaPlayer.framework).
So I go into my Target settings and try to add it to the "Linked Libraris" by hitting the [+] button. In the list the MediaPlayer.framework is missing, as well as other frameworks, such as UIKit, CoreGraphic and others. Some frameworks are still there.
I can add the frameworks by adding the SDK-specific ones (going into /Developer/Platforms/iPhoneOs.platform/...yadayadayada../frameworkd/) but then of course I can only compile for the iPhone platform and not for the simulator any more.
So basically I wonder how I can get Xcode back to chose the appropriate framework, depending on platform and SDK version for me?
Thanks and kind regards, Hans Schneider
Edit: Things I tried: Setting the Base SDK to 3.0 (was still 2.2.1), reinstalling 3.0 iPhone and Simulator SDK from the "packages" directory of the Xcode 3.2 DMG. Didn't help. The frameworks still wont show up in the list...
Edit 2: Ok, I now have the frameworks back in the list, I was previously in my AdHoc configuration. In Debug I have the frameworks back. But it still wont compile for the Simualtor (lots of Symbols(s) not found errors).
Looks like the linker doesn't choose the correct libraries and always uses the iPhoneOs3.0 path for the frameworks.
Goto 'Framework Search Path' in build section in target's property.
Add path:
$(SDKROOT)/Library/System/Frameworks
Then it should work well.
And once you press 'OK', you should be able to see the path is set to '/Library..."