XCode 4.5 (4G182) + iPhone 5 iOS6 - Choose a destination with a supported architecture in order to run on this device - iphone

So I have a brand new app I created last night for iOS6, using XCode 4.5. I can properly develop on my iPhone 4 with iOS6.
Today I got my new iPhone 5 with iOS6 and, after updating the certificates with the new device UUID, I tried to run my app on it and got this error:
XCode cannot run using the selected device. Choose a destination with
a supported architecture in order to run on this device.
I've enabled the device for development. Both armv7 and armv7s are on the settings.
I have included the sources from the Facebook 3.0 SDK and the linker flag '-lsqlite3.0'. I'm guessing the issue has to be related, but cannot figure what is wrong.
Any ideas how to solve it?
PS: The issue happens too when running the app on the simulator. No idea what changed on my project or XCode between last night and today, other than I have a new device and new certificates.
The selected destination does not support the architecture for which the selected software is built. Switch to a destination that supports that architecture in order to run the selected software.

Also you need to select the compiler LLVM in
Project --> Build Settings --> Build Options

I have found the same issue while running an OLD project on XCode 5.0 and My solution is:
You need to do following steps for getting out with this:
1. Set Valid Architectures : armv7,armv7s
2. Set compiler as LLVM in Project ---> Build Settings ---> Build Options.
3. Set Base and Deployment sdk properly.
This is my solution. Happy To Help.

You need to add armv7s to your valid architectures under your Target's Build Settings.

You included src/Framework/Resources/Info.plist when added Facebook SDK files to your project. Just remove it from your project and everything will work again. Guaranteed! :)

I have solve the problem using the below steps.
Close the Xcode
Delete the application from device
Restart the device
then re-run the application
it is working fine..

Make sure the bundle name (in plist file) is same as the project name. I changed it and it worked.

One of my 3rd party libraries couldn't run on armv7s so I removed that option. I also removed armv6 and kept armv7 as the only option. It built and ran on the phone with only armv7.

I have solve the problem using the below steps.
Close the Xcode
Delete the application from device
Restart the device
then re-run the application
it working fine..

I faced this problem because Build settings-> Complier for C/C++/Objective c was set wrong.
So I changed it to default compiler available, it worked!

Just need to select the compiler LLVM in
Targets --> Build Settings --> Build Options

I ran into the same problem. When I check the compiler it is showing incompatible compiler. you need to make it valid one. To set valid compiler follow the steps
select your
project----> build settings-->
on the search bar type compiler and search
now you can find build options under build options you will find compiler for c/c++/objective c set it to valid one.

So basically I created a new project, copied all the sources and everything seems to work fine. At least the app runs.
I am not sure which setting was causing the problem.

I had an issue with an out of data library that was built for iOS 4.x and I was building a new app for iOS 6 with iPhone 5 support. I received this error and the only way I resolved it was to make armv7 the only architecture and valid architecture listed in my project and target build settings.

remove info.plist refrence. And then re-drag info.plist to proj but don't copy to "target"

You just goto Build setting Then valid architecture Replace armv7 armv7s instead of armv7 .Then it will work fine .

Ok, not sure if this is the Problem in Your Project. But what fixed it for me, was to change the Name of the Info.plist File.
I changed the name from Info.plist to my-project-info.plist
also change it under target-build-settings/Packaging/Info.plist
Than delete the App from Devices/Simulators and re-run the App through Xcode
In my Case, everything worked fine since than. In my Case there was nothing wrong with the specifications made in the plist file or with the valid architectures.

some times this happens when your project was build in xcode 4.5 and you are trying to run in xcode 5.0.
so in my case I found the solution.
Change your compiler for C/C++/ObjectiveC Go to Build
Settings->Build OPtions->compiler for C/C++/ObjectiveC; select
Default(Apple LLVM5.0)

Related

dyld: Library not loaded: #rpath/libswift_stdlib_core.dylib

I get this error after adding a Swift class to an old Xcode project.
dyld: Library not loaded: #rpath/libswift_stdlib_core.dylib
How can I make the project run again?
For me none of the previous solutions worked. We discovered that there is a flag ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES (in earlier versions: "Embedded Content Contains Swift Code") in the Build Settings that needs to be set to YES. It was NO by default!
This error can occur if something went wrong during the conversion of an Objective-C project to start using Swift. The issue is that the Linker build settings never got configured properly, so you'll have to do it by hand. Look for the Runpath Search Paths build setting and set it to:
$(inherited) #executable_path/Frameworks
EDIT: I should also add that there has been recent spate of these errors caused by something else entirely - Apple made a change in Swift itself, starting in perhaps Xcode 6.1 or 6.1.1. The only solution seems to be to quit Xcode, destroy your certificates in Keychain Access, go to the Member Center and delete all certificates and profiles (except the profiles for apps in the Store - you can't delete them), and then start the entire certificate request process from scratch.
I'm not really sure why this question is being downvoted, I had this problem as well when I first tried to use Swift with an existing project. An Xcode restart also fixed this for me.
I searched long on this issue. There are several reasons causes this issue.
If you are facing when you and Swift code/library in an Objectice C project you should try Solution 1-2-3
If you are facing this issue with a new a Swift project Solution 4 will fit you best.
Solution 1:
Restart Xcode, then computer and iPhone
Solution 2:
Go to project build settings and set Always Embed Swift Standard Libraries (previously Embedded Content Contains Swift Code) flag to YES
Solution 3:
Go to project build settings and add #executable_path/Frameworks to Runpath Search Paths option
Solution 4:
If none of above works, this should. Apple seems to be ninja patched certificates as mentioned in AirSign's post
At InHouse certificates
Subject: UID=269J2W3P2L, CN=iPhone Distribution: Company Name, O=Company Name, C=FR
they added a new field named OU
Subject: UID=269J2W3P2L, CN=iPhone Distribution: Company Name, OU=269J2W3P2L, O=Company Name, C=FR
so you should just recreate certificate and provision
In my case I was trying to import a custom framework and was getting the similar error.
Turns out I had to import the framework in the Embedded Binaries rather than in to the Linked Frameworks and Libraries.
Embedded Binaries are under Projects Settings -> -> General
For developers who have had this issue with a Adhoc/Enterprise distribution builds,
Create the production certificate from dev portal and then regenerate the distribution profile. Download and install both of them on your Mac. Ensure you selected the right profile in your Xcode build settings and rebuild your app.
Source: https://devforums.apple.com/message/1022908#1022908
Solution 5:
In my case, all solutions mentioned in the answer of accfews were very helpful but none has worked. I solved my problem by adding my swift library in the section "Embedded Binaries" in the "General" section of my Project's target. Perhaps is this due to the fact that I have included my swift framework in my workspace? Whatever it compiles now! Get ready Swift, I'm here!
A simple restart of Xcode solved the issue for me.
For me, the issue was due to the fact that my Apple Worldwide Developer Relations Certification Authority was invalid.
Download it from here:
https://developer.apple.com/certificationauthority/AppleWWDRCA.cer
Drag and drop it into Keychain Access, clean the project, and run.
I had an Obj-C project where I started adding swift source files.
The following fixed the issue for me:
Linking: RUNPATH SEARCH PATHS = $(inherited) #executable_path/Frameworks
Swift Compiler - Code Generation: EMBEDDED CONTENT CONTAINS SWIFT = YES
I just created a new project from the templates Xcode 6.3 and compared the project settings with my old original project.
Try to hold Alt, then go to Product -> Clean Build Folder...
Hope it will help someone..
The reasons for this occurring are many. Having just spent a fun weekend finding yet another issue that causes this (the order of code signing), I wanted to create a summary answer that brings all the possible solutions together:
Add Embedded Content Contains Swift Code to project. You need to set this flag if your app contains Swift code.
Clean project. In addition to a Project > Clean you can also delete the DerivedData and Build directories. Look under the Preferences for the location of DerivedData. Build should be in your project folder.
Ensure Runpath Search Paths contains #executable_path/Frameworks.
Ensure that your certificate contains your Apple Team ID in the OU (Organization Unit) field Apple will add this for you, just revoke your existing distribution certificate and create a new one, download, install on KeyChain, regenerate all provisioning profiles, download those and rebuild.
Xcode restart. If everything is basically good, but Xcode hasn't gotten there yet.
That's the easy stuff. If you are doing your own command line build you may be creating your own .ipa files to upload. In that case you need to ensure the following:
Make sure the version of the Swift files in SwiftSupport/iphoneos is the same as the version in Contents/YourApp.app/Frameworks Because Swift is not yet binary compatible between version, you must ensure these versions are the one that you built your app with. You can find these libraries under /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos.
Sign the libraries and frameworks first. You need to codesign the libraries and framework files (under Frameworks in the .app folder) first and then sign the entire .app tree. The .app tree must be signed with an entitlements.plist but not the frameworks.
Hopefully when Swift 3.0 comes out and we no longer need to bundle Swift with our apps this whole issue will go away.
I had this issue using an Ad Hoc (or enterprise) mobileprovision with a production certificate. Switching to a development certificate and mobileprovision solved the issue.
My project is a Swift project with some Objective-C classes.
I had the same problem when signed with old inHouse (enterprise) certificate.
The following steps fixed this for me.
Create and use a new certificate and mobile provision.
(Ref. AIRSIGN’s blog)
Set Runpath Search Paths build setting to: $(inherited) #executable_path/Frameworks.
(Ref. matt’s answer)
Solution 6:
In our case, the Enterprise Distribution Certificate had been revoked. Generating a new certificate and updating the provisioning profile fixed the issue.
(There seems to be many different causes for this error. Hope this helps someone.)
I tried all the answers given above, nothing worked.
Finally worked after updating to Yosemite
I have faced the same issue, setting the right code sign identity solved the problem(Build settings->Code Signing Identity).
As per Apple technical question "All Enterprise and standard iOS developer certificates that are created after iOS 8 was released have the new Team ID field in the proper place to allow Swift language apps to run"
If you add the three frameworks via Embedded Binaries, they will be added to Linked Frameworks and Libraries also. Delete the three entries in Linked Frameworks and Libraries will solve the problem.
Magic methods such as relaunch Xcode and restart the Mac doesn't work on me.
Adding Framework as "Embedded Binary" instead of just "Linked Frameworks and Libraries" - Fixed my issue.
I also set Embedded Content Contains Swift Code flag to YES.
Upgrade to Latest Version of OS X (Yosemite)
After hours of trial & error I came to the resolution of this problem.
- If this applies to your case of course.
I had the same problem until I upgraded my Mac OS X from Mavericks to Yosemite.
- It fixed my problem, hope it fixes yours as well
I tried all the solutions that found on web, including to Apple and new certificates. Without success.
The only way I could run xcode, after 6 months of trying, was creating a new account on my macbook.
Usually this error will disappear if you add this library to the "Copy Files" segment in your Build Phases.
My environment: Cocos2d 2.0, Box2d, Objective C
In addition to doing the other answers above I finally went to the General tab and made WatchKit Optional.
And if all of the above doesn't help you and you really get frustrated... Try the best trick of all: Clean and just to be sure also Clean Build Folder. :) Hope it helps somebody!
None of these solutions seemed to be consistently working for me; after every couple of successful runs, it would fail again. The "Embedded Content Contains Swift Code" flag was always set to YES for me.
Turns out I'd set Xcode to be 6.3-compatible. Changing it back to be 3.2-compatible solved it:
I've had this problem as well, only it wasn't locating libswiftXCTest.dylib.
The solution was to add XCTest.framework to the Tests target, in Build Phases/Link Binary with Library. I was getting this error even when I was trying to build the main target.
This showed up when I added a new Today extension target with Swift language to an old project.
Fixed easily by updating the project to recommended settings. Xcode 6.0.1
I got the same issue using Mavericks, Xcode 6.1.1, testing on an iPhone5 with iOS 8.1.1. I tried all possible solution including new certificates and provisioning profiles, but nothing helped. I did the changes to Embedded Content Contains Swift Code and Runpath Search Paths both on Project level and Target level.
I have now installed Yosemite, and without any further changes, it started to work.
Same issue here, for me it was Crashlytics/Fabric/Beta/Twitter/Whatever-they-call-themselves uploading a binary that was missing the embedded frameworks. If I made an archive and then exported an Enterprise build in the standard way, they worked a charm.
After months and months trying everything here... Definition of insanity... starting Xcode under a new Mac user solved it for me.
I removed ~/Library/Developer/* and reinstalled Xcode- so no clue what else to format to make it work.

Cocos2d-x project's 2nd rebuild onwards gives an error 'Xcode cannor run using selected device'

Fresh cocos2d-x project build using Xcode runs normally on iOS simulator/device, but after making changes to cpp source files, rebuild fails with error-
Xcode cannor run using selected device. Choose a destination with a supported architecture in order to run on this device.
The only way to make it work is delete build binaries (i.e. delete XCode>Derived Data folder), and take fresh build after restarting Xcode.
Can someone please help me resolve this issue?
Additional Details:
This error is related to mismatching device architecture and armv6 armv7 flags. But first build works fine, and stops working after second build onwards, that means this is not a possible issue.
If the project is not using cocos2d-x (i.e. plain Objective-C project), then there is no such error after second build.
Compiler selected: Apple LLVM Compiler 4.2
Thanks in advance!
Following my comment you should make sure you use the latest templates for creating cocos2d projects. Some templates will only work for a specific Xcode version so make sure you use the right templates for your xcode version (There are some for xcode 3.x and others for xcode 4.x)
Change Valid architecture to armv7 and armv7s. Remove armv6. See image for more information.

XCode 4.4.1: Can't Deploy to Device or Simulator: Unsupported architecture

I'm having some trouble deploying to any device in XCode 4.4. I have only tested on armv7 devices, but I only wish to deploy to armv7. The application compiles without issue.
Device Error
Simulator Error
I have checked that the Architectures and the Valid Architectures in the build settings contain only armv7.
I'm working in an XCode Workspace with one project and one subproject. The subproject creates a static library which acts as a target dependancy to the main project.
Other questions suggest that the deployment target might be wrong, but I checked this too and it is set to iOS4.0 for all projects and targets. (All devices are iOS5.0 +)
Does anyone have any suggestions please?
Though I couldn't find exactly why this was happening. I fixed it by removing the project data.
Close XCode
Open Terminal
cd to your .xcodeproj directory
Recursively delete any project data files associated with the current user name
find . -name "YOUR_OSX_USERNAME_HERE*" | xargs rm -rf
Reopen XCode
Just for luck, do a clean build
Edit
Had this error again and wasn't solved by the above steps alone. There were two other factors:
Make sure Info.plist isn't part of the Target Membership
Clear DerivedData
Quit Xcode and iPhone simulator
Unplug your devices
Goto ~/Library/Developer/Xcode/DerivedData/
Delete all data under this folder
Start Xcode again and run your project
I've found that Xcode really seems to like '$(ARCHS_STANDARD_32_BIT)' for 'Architectures'. If its not set to that try it, 'Valid Architectures' with armv7.
Just curious - if building for newer phones only, why not use a deployment target of 4.3? You'll be able to use some of the new block technologies not in the earlier releases.

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.

Missing frameworks after upgrading to Xcode 3.2

I upgraded to Xcode 3.2 and now can't seem to add a number of frameworks, specifically the media player. A number of frameworks do not show up on the "Add Existing Frameworks Sheet".
Per another question I tried setting the "Framework Search Path" to
$(SDKROOT)/Library/System/Frameworks
but that didn't seem to make any difference. The UIKit.framework that is included by default when I create a new project is in
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.sdk/System/Library/Frameworks
which I would expect. If I navigate to that directory I see the MediaPlayer.framework and can drag and drop it into my project successfully, but can only build and debug for a device-no suprise there, but not ideal.
I uninstalled the dev tools with
mode=all
and reinstalled Xcode, but still no relief. Any help would be greatly appreciated.
Your project was probably configured to use an older SDK that's not included in the Xcode 3.2 + iPhone SDK package. Go to your target's Get Info panel, Build settings, and set the Base SDK to an SDK that's actually installed.
If you want your app to run on older iPhone OSes, set the iPhone Deployment Target build setting to the earliest OS you want to run on.
I just had the same issue when upgrading to 3.1.2. One thing you will want to do is open your Xcode Project, right-click on the project and Get Info... Then change the Base SDK for All Configurations to (the minimum of) 2.2.1.
When I did this it re-linked all of my RED (missing) Frameworks. Cheers!
I know this question is over a year old, but I just had a similar problem and solved it by looking for the missing framework in the trash and putting it back.
I must've deleted it by accident!
Possible Solution 1: Clean Your Project
Build > Clean All Target
Possible Solution 2: Make Sure Your Device is in Correct Firmware
To debug, read console log.
Hope it helps.