iOS app fails to create archive in Xcode but builds fine - ios

This completely baffles me. I have a project that used to archive just fine, but after I updated Xcode it is now failing to create an archive for it. The failure is from an included project source file not finding a header. Again, this is one that built just fine before and now failing. Also, it builds and runs just fine, just failing on archive. This is the version of Xcode I am using: Version 7.1 (7B91b).
Has anyone encountered similar issues?
The error is basically:
'Header.h' file not found
Again, that file exists. Its there. The project runs and builds just fine. It only fails to find it during 'Archive'.

You said that the failure is from an included source file. I have seen some people with a similar problem when they imported the Cordova library. Some of them solved it with the solution given here.
Add this line to your Build Settings -> Header Search Paths:
"$(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include"
Don't replace the existing line that looks similar, that is still needed to be backwards compatible with Xcode 7 and Xcode 6.4.
Good luck!

Adding this to my "Header Search Paths" fixed the problem.
"$(BUILD_ROOT)/../IntermediateBuildFilesPath/Headers"
Apparently certain folders where the headers reside are not built during the "Archive" process.

Maybe cleaning and building your project fixes the problem?

You need to select a real device as the target, otherwise archiving doesn't work. But can you build release builds at all? (For example, does "build for profiling" work? )

You need to select a real device as the target, otherwise archiving doesn't work. But can you build release builds at all? (For example, does "build for profiling" work? ) For example, you might have a line
#ifdef DEBUG
#include "MyHeader.h"
#endif
and the header won't be included in a release build. Easily done.

Related

Custom Module not found

I'm a beginner in iOS development. I cloned a repo containing working code. I opened up the project in xcode, but when I build the project I receive the error Module 'Subscriptions' not found.
In my build settings, the Subscriptions.framework framework is in Linked Frameworks and Libraries. From what I've researched about module not found errors in xcode, this should be the fix for my problem. However, this is not fixing my problem. This project should normally be able to be built and compiled. Is there something I'm missing here?
Update
Here is the xcode file tree view.
Main
|-Main
|-MainTests
|-Products
|-Frameworks
|-Subscriptions.xcodeproj
|-Subscriptions
|-Products
|-Subscriptions.framework
|-Frameworks
|-Pods
Pods
Ok. I finally figured out what was going on. I dove into the directory I thought that the Susbcriptions.framework was being installed in, and it wasn't there. The directory in the build products path was set to Products/Debug-iphoneos but the Subscriptions.framework was instead being installed into Products/Debug. This made me realize that somewhere in XCode I had the build setting set to build for MacOS instead of iOS. I found the setting and rebuilt my project for an iPhone XS simulator and the module was imported successfully.

Warning message in existing project after upgrade to Xcode7

I have just recently upgraded to Xcode 7 and now I get this warning:
ld: warning: directory not found for option '-F/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/Developer/Library/Frameworks'
I researched different forums and everybody with similar issue recommends to remove paths from build settings but I can't find any paths there resembling iPhone simulators....
I had the same issue, here are the steps that worked for me
open your project
got to TARGETS
select youAppNameTests
select Build Settings
Framework Search Paths
Delete every thing from Debug and Release fields
clean project
Hope it will work for you too
The problem has to do with the test target. Delete your test target. (Copy the code out to some other program if there is any.) Quit Xcode and clean out the Derived Data folder. Now open your project again, and the problem will be gone. If necessary, now make a new test target.

Xcode archive validate button greyed out [duplicate]

I have a problem generating a iOS App archive from an application. The application compiles just fine and even works in the simulator. Now I wanted to make som ad hoc testing and cannot generate the iOS App Archive. When I click on the Product -> Archive it generates a generic xcode archive. Can anyone help me. I should mention, that I have already generated an iOS App Archive of this application. It has just stopped to generate iOS Archive for some reason. Thanks a lot.
Check Build Settings:
Skip install is NO for the main project target
Skip install is YES for framework (sub-projects) targets
In Build Phases for sub-projects, Copy Headers needs to be in Project, not Public (does not apply if building static library)
Installation Directory under Deployment is valid (/Applications for example)
This can happen if you've added a framework/library ... you need to edit the Target->Build Settings of that library and set the 'Skip Install' setting to 'Yes'. When you re-archive, XCode should start producing a 'iOS App Archive' again rather than a 'generic xcode archive'.
In addition of Skip Install to Yes and in case you opened another lib/framwork project within your app project you have to move headers (if any) from public to project in the Build Phase / Copy Headers.
I did the following to make it work for me:
I had a three20 static library, I used cocoapods to include the files within the main project
followed the skip install for all other sub projects/static libraries and switched the copy headers from public to project as stated above
most importantly: in each library your project uses go to build phases -> Copy Files and ensured that destination is changed from Absolute path to products directory. Note: see the hint below to narrow your search to find the library causing this error.
and that was it!
hint: to get an idea of the offending files that's causing your archive to create an archive file rather than an ipa do this:
Select the archive and click the Distribute button.
Select the 'Save Built Products' option.
Hit Next and Save.
Browse the created directory in Finder.
The 'libraries' subdirectory will identify the libraries that you need to set the Skip Install to Yes.
in some cases usr/local/include will identify the culprit header files you need to move from Public to Project or the files that you have to change from absolute path to products directory (or even the files you forgot to set the skip install to yes flag). but that directory (ie usr/local/include) varies depending on your sublibrary directory structure. In many cases.. you will see all the files listed under Copy Files in step 3 above listed here. If you find them here, then you have a definite answer for the cause of your problem.
update to hint: to make life even more simpler.. whatever files appears under step 4 in hint above.. simply search for it in the global search of xcode.. and you should get immediate results for what you want.. for example, this was the content of my folder (following the steps in hint above):
So I could tell it has something to do with the crypto and ssl libraries.. searching for them:
made me realize that i forgot to set skip install to yes.
If you export the archive, open it and see /urs/local/include in Products try this suggestion:
In each pod, under Packaging, Private Headers Folder Path and Public Headers Folder Path is set to /usr/local/include. If I clear them then I get a valid archive.
Worked for me after upgrading my React Native app to 0.11.0, Xcode 7 and CocoaPods 0.39.0.beta.4.
If you're using CocoaPods as well as WatchKit or a Today Extension, there is an open issue on the CocoaPods repo explaining what your problem might be.
The solution for me was to remove the Copy Pod Resources phase from the WatchKit Extension and Today Extension targets under Build Phases. The project compiled and archived as expected once I did this.
Hope this helps someone, this had me stumped for an entire day!
If any of the above answers don't work, your issue is probably with cocoaPods. The latest update 0.38.1 messed things up for me, but then i downgraded to 0.37.1 and things returned to normal. Using Xcode 6.3.1
Later edit: updating to 0.38.2 will also fix this. More info about what caused this issue here: Cocoapods 0.38.1 failed to create valid Archive
Although I'm using Xcode5 and what sorted it for me was editing the Build Scheme - trying all of the above suggestions that were applicable didn't help in my case.
I had two targets, say, "App" and "App FREE". My problems with the generic archive happened when I was trying to Archive the FREE version, which I added after the 'normal' version of the app. In my case, when I selected its Scheme in the toolbar and chose Edit Scheme ... I saw that Build section had two targets, namely App and App FREE.
I unchecked all columns for App, leaving only App FREE's columns checked, and clicked OK. Next time I chose Product > Archive I got my App FREE instead of a Generic Archive. :)
If you have only single project, maybe this solution would be useful.
This problem had occurred, when I duplicated the target. As a result I had two targets parallel built. This was causing the issue. Generic IOS archive was built.
To turn the parallel built off go to
Manage schemes,
Edit scheme,
Build,
Remove the other target.
I had this problem after updating to iOS 9 and Xcode 7. Josh H's solution worked for me:
In each pod, under Packaging, Private Headers Folder Path and Public
Headers Folder Path is set to /usr/local/include. If I clear them then
I get a valid archive.
I also made a post install script for my Podfile to do this automatically!
post_install do |installer_representation|
installer_representation.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['PUBLIC_HEADERS_FOLDER_PATH'] = [""];
config.build_settings['PRIVATE_HEADERS_FOLDER_PATH'] = [""];
end
end
end
Just add it to the bottom of your Podfile and run pod install
I had this issue. In my case, it was caused by keeping a Mac app target as a dependency of the iOS app.
The reason it was setup like this was that the Mac app was a tool used to generate some data for the iOS app, which was then included in the bundle.
I had to remove that dependency and build the tool separately before making a build of the iOS app itself.
In my scenario I was getting the erroneous "Generic Archive" only after I began including Swift code in my predominantly Objective-C project. After lots of troubleshooting and examination of the archive file that Xcode was spitting out, I noticed that the SwiftSupport folder (with the required dylibs for the Swift runtime) was in a different place in my archive than from a vanilla brand-new Swift project app archive.
I found the Installation Directory build setting and noticed it was set to a custom path in my project. I simply deleted it (setting it to its generic value of /Applications) and the next Build -> Archive I did worked as expected and gave me a proper iOS App Archive.
TL; DR: Make sure your Installation Directory build setting is set to its default value of /Applications when including Swift code in your app, especially if you are starting with an older project file that may have some unexpected legacy build settings.
I have multiple project in my workspace, (GTL, Pods and my main project) and this is what worked for me:
Select the Project, there will be 2 types there, there's the Project and there's the Targets.
For projects that is not your main like GTL or PODS:
Projects:
Skip Install = NO
Installation Directory = /Applications
// For pods
Private Headers Folder Path = ""
Public Headers Folder Path = ""
Targets:
Skip Install = YES
Installation Directory = /Applications
// For pods
Private Headers Folder Path = ""
Public Headers Folder Path = ""
For the main project (which is usually named the same as your product name):
Projects:
Skip Install = NO
Installation Directory = /Applications
Targets:
Skip Install = NO
Installation Directory = /Applications
Check the ios deployment target on each projects and targets to make sure they are all the same.
Leaving this here to save others from the same journey.
I found I needed to remove the same Copy Pod Resources build phase from a static library target in my workspace too.
Addition to Alex L 's answer.
Point 3. Change 'Build Settings' -> 'Public Header Folder Path' to 'include/xxx' also works.
If none of the above helped you...after a lot of time.......
I deleted the value in the Info.plist for Bundle Version because I was happy enough with just Bundle Version Short 1.0. Bad. Don't do this.
*Note I actually did this by editing it in the UI on the right not realizing it would put an empty key in the Info.plist file. I think that makes it invalid. My bundle showed up as other items while archiving and had no icon, and I couldn't upload to anywhere.
This boils down to invalid values in the Info.plist. If it's not a valid archive, try unzipping an old archive and dropping in / overwriting your current one and see if it fixes it when rebuilding the archive.
Go to Build Settings and add
yourAppName/Resources/dist.plist to the Code Signing Entitlements
Press cmd + B with iOS Device or a Real Device selected as Build Target
When done -> scroll to "Products" folder and right-click on yourAppName.app
Choose "Show in Finder"
Create a folder with Name Payload (capital "P")
Copy yourAppName into your Payload Folder
Create a zip from your Payload Folder
Rename the zip to yourAppName.ipa
DONE
After trying just about everything:
Clean, Archive
delete DerivedData, Archive
restart Xcode (I was using XCode7), Archive
combinations of above...
I then noticed my boot partition was 'low on free disk space'... about 1GB or so.
I rebooted, then got about 18GB free.
Then opened Xcode and project, performed Archive... and surprisingly (after an hour of trying to build an Archive) I finally got a non Generic Archive.
No idea if its a free disk issue which fixed it or a reboot of the macOS that fixed it, but it worked for me.
If you have any .xcodeproj files in Project>Targets>Build Phases>target dependencies remove it from there and then build your ipa. It works for me. Cheers
You can get answer here : xcode is creating generic xcode archive instead of iOS App Archive
In my case, i had to move both FMDB and BlocksKit to static libraries. Previously they were built as subprojects. Remember you can use lipo to create universal libraries. When building the final products, the simulator code will be stripped automagically.
Another possible reason for this is to have references in "Target Dependencies" to projects for a different platform. In my particular case, I was working on a project that shares code for OSX and iOS. In one of the iOS targets, I had accidentally added an OSX target as dependency.
In order to be thorough, I am posting my solution.
I experienced the exact same problem trying to build an Archive of an iOS project in Xcode 5.1.1 (5B1008). None of the above suggestions fixed the problem, and most of them were irrelevant (I had not added any Frameworks, and did not have any Public entries in the Copy Headers section of my Build Phases).
In my case, fixing the problem consisted of simply closing my project, deleting any archives that I had previously made, going to Preferences > Accounts, removing my developer account, quitting Xcode, relaunching, re-adding my developer account, starting the Archive process again. This fixed my problem immediately.
One more solution, since all the above didn't work for me...
Changed the User Header Search Paths (I suppose Header Search Paths would work just as elegantly) to "$(BUILT_PRODUCTS_DIR)/BlocksKit".
Background:
In BlockKit, the developers have structured the headers in the main project differently than the structure on deployment. So, you can't reference the headers in the project, and must reference the headers copied into the build directory.
The way this worked for me in (Xcode 5) I had 2 targets and when I edited the scheme, on the left pane of the scheme editor, you will see the [BUILD, RUN, TEST, PROFILE XXX.APP, ANALYZE, ARCHIVE] from the BUILD pane, you will see your project targets listed in a list. At the far right end you will see the ARCHIVE selections, make sure only one target is selected for archiving.
I had 2 of my targets selected in my project, I checked only the target I wanted in the product, and it worked!
I solved this error by opening solely the app project in XCode, ie. not opening a workspace comprising the application and other projects/libraries/frameworks.
Having 2 separate project, a framework or shared library and an iOS application, I had to open 2 different XCode windows, each by directly opening the .xcodeproj file instead of the common .xcworkspace, in order to preperly build each.
As a nice side effect, XCode no longer rebuilds every target of every project after I do a Clean, resulting in shorted build times.
Background: I am creating an open source SDK, and a demo iOS application. I had both opened in a single workspace.
Setting Skip install to YES on the SDK targets would prevent anyone from creating an archive, as it would be empty, so this was not an option. Using Project instead of Public headers would lead to an archive missing the header files that should be distributed, so this was not an option either.
For it was because i was working in a workspace.
The project did archived but would ne be displayed in the organizer window.
I closed the workspace and open the project on its own.
The archived has been opened in the organizer ... hope it's help.
In my case, I had a custom script that was copying some temporary files into:
${TARGET_BUILD_DIR}/myTempDir
That meant that, after investigating the archive to inspect its contents, I found right next to the .app file a myTempDir folder. Once I modified the script to save elsewhere things were sorted.
Try setting $(PROJECT_NAME)Headers in Framework projet's Public Headers Folder Path. You have to go to build settings of the Library Target then edit the Public Headers Folder path as $(PROJECT_NAME)Headers.
If using Xcode 7 with cocoapods v.0.38.2. Try removing copy pod resources from your today extension target.
I encountered this problem after adding a OS X command line tool to my iOS app's project, and Skip Install was set to NO by default for the command line tool's target. Since you obviously can't install an OS X binary to an iOS device, archiving defaulted to a generic Xcode archive. Setting Skip Install to YES for this target fixed the problem.

Restkit/Restkit.h file not found Xcode 6.1

I was working on Project in Xcode 6.1. It was working fine and all of sudden it prompted an error 'Restkit/Restkit.h file not found'. I'm getting error after changing Architectures from $(ARCHS_STANDARD_32_BIT) to Standard architectures (armv7,arm64) - $(ARCHS_STANDARD) which is recommended by Apple Check Link
I have tried following approaches :
1.'Cleaning' project and rebuilding
2. Checked for missing framework in Target -> Build Phases
3. Fixed 'Framework Search Path' of Target
4. I have build Restkit XcodeProject and Targets separately. It builds without error.
I was getting below error while submitting to App Store and hence changed architecture to 'Standard architecture'
Why did this occur all of sudden? How to fix it?
Just to be here. There is similar issue in newest Xcode 7+. You can observe "RestKit/RestKit.h file not found" failure on archive build. You could compile and run apps on emulator but archive would fail.
To fix this you need to add one line to "Header Search Paths" in Build Settings:
"$(BUILD_DIR)/../IntermediateBuildFilesPath/Headers"
Be sure to include the surrounding quotes.
You have not properly changed Architecture , if you have done properly than it will show you like this,
Proper Architecture setting:
So again properly change Architecture and try again.
This is your Architecture Setting
I had used third-party static library in project named libNuance.a. It seems that this static library works fine for 32-bit architecture but failed for 64-bit architecture.
I downloaded updated version of libNuance.a library from their official site and changed architecture to Standard architectures (armv7,arm64) - $(ARCHS_STANDARD).
Vola! build succeeded without any error.
First you can try, look for it in project navigator(left side) and delete if it is red.After that add the RestKit again.Be sure when adding check the copy if needed box and packages contains headers.
Also you may try just #import "RestKit.h"
I had solved this in many cases by deleting the contents of DerivedData folder. See the following questions on how to do this:
Can I safely delete contents of Xcode Derived data folder?
How can I safely delete in my ~/Library/Developer/Xcode/DerivedData directory?
If you have Pods configured then and if you have upgraded recently your Xcode, try reinstalling cocoapod and all the reinstall all required pods.
I fixed this issue, to change the Header Search Path
"$(SOURCE_ROOT)/RestKit-RestKit-c19a500/Build"
Note : "RestKit-RestKit-c19a500" this is my RestKit folder name.

Xcode Cannot Run on the Selected Destination

I was running my app this morning and now all of a sudden I am getting the following error when I try to run on the iPhone 5.1 simulator.
Cannot run on the selected destination
The 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.
I deleted the schemes but still no solution.
I am using Mountain Lion. I am using xCode 4.4 (Recently upgraded to Mountain Lion and xCode 4.4)
UPDATE 1: Here is the view of my build settings:
UPDATE: Here is the actual error which prevents from it running.
You might follow the steps:
Quit Xcode and iPhone simulator
Unplug your devices
Goto /Users/your_usr_name/Library/Developer/Xcode/DerivedData/
Delete all data under this folder
Start Xcode again and run your project
Hope this will solve your problem.
I had this issue after updating from Facebook SDK 3.1 to Facebook SDK 3.1.1. My fault, I guess.
Inside "resources" folder, now there is a totally useless but dangerous info.plist that, if imported, may break your project file. Don't know why they included it but I believe few of us made the same mistake recently.
I found this problem with the version of Xcode 4.4. And finally I solved it this way:
Find the "Info.plist" in your project, then unselect the target membership plus on the right side view of window, it works for me.
You might also want to check if the project uses a supported compiler in the project settings
Its just duplicated Info.plist file
just use 1 Info.plist file in files then restart xcode
its fixed for me
I have just encountered this error in Xcode 4.5.1, and the error went away after I take all non-alpha characters out of the Product Name build setting.
I believe this may be a current unlisted bug with Xcode 4.4+. I have/had the very same issue with my project. I deleted all versions of Xcode and restarted with 4.4, opened my project and had the error again.
I then started a new project with a template with a different name. Did not have the issue.
I then renamed my old project, started a new empty project with the same name and built/ran and got the error again. This new project was nothing more than a view controller that didn't do anything. I should have gotten a blank screen but got the same error you did.
Frustrated I shut down for the day and re-ran the old project and it worked. I had not changed anything. Currently I have the error again and neither rebooting or restarting Xcode fixes it.
So in summary, a project can have absolutely no changes made, sometimes it builds and runs fine, sometimes you get this error. For the record I did not get this error running Xcode 4.3.
My issue did not show up until I upgraded to Mountain Lion and Xcode 4.4 which happened to be on the same day. Now I can not get back to a 100 percent workable configuration.
Committing my files to SVN and checking out the project in a new directory fixed this for me.
Look at both the project and target build settings, at that Architectures, and see if anything has changed. When first going from Xcode 3 to 4, it use to wreck havoc in a hidden way, giving the same error, and in the end you had to add i386 to the "Valid Architectures" line. I just looked at my big project started in Xcode 4.1, and it shows nothing about i386 etc, but I have other newer projects where I get this grayed out thing in that line $(ARCHS_STANDARD_32_BIT).
EDIT: I took a relook at this with a guru friend. Neither of us can find a linkage to i386 in our projects - Xcode is using some magic. That said, I did get a hit to i386 in a binary plist within the project, which leads me to another suggestion.
In your build settings, insure that ALL "Architectures" are $(ARCHS_STANDARD_32_BIT).
If that does not work, we suggest that you look at the compile and ld lines of your build when you select iPhone 5.1 Simulator in the scheme menu - to see if in fact its i386,
Another idea - move all your schemes and user settings to a save folder somewhere (with the project closed), then reopen and recreate a scheme. Now try again. There is no reference to i386 in any of my project.pbxproj files, so our suspicion is that this is somehow related to the scheme setting for the target device.
Good luck!
I've solved changing in both the project and target build settings the key "Build variants" from "armv7" to "normal"
in addition to deleting all the files in this directory
Users/your_usr_name/Library/Developer/Xcode/DerivedData/
i restarted my mac and it worked fine (restarting xcode and the simulator didn't cut it for me)
I was running into this same problem. In my case, it appeared to be that I had changed the Bundle Name for my multi-target project instead of the Product Name. Once I corrected that by editing the Project Name correctly and then setting the Bundle Name back to ${PRODUCT_NAME} it would run in the simulator again.
This may not be the answer for everyone, but it does appear that product naming errors (special characters, spaces, etc.) are a contributor for many, and that's what drove me to review the renaming that I had one.
I was facing the same issue with my project. Here's a brief explanation of the situation and my resolution. This may or may not work in your case.
I work at a place which has multiple iOS projects going. I recently had my system upgrade to Mac OSX 10.8 and Xcode 4.4.1. I was working on a project that was originally built on Xcode 4.1 for iOS 4. Since Xcode had iOS 4 simulators until 4.3, the project built and ran fine on all simulators. In Xcode 4.4.1 however, I did not find iOS 4 simulators and there is no easy way to install them either, which is why I was getting the "Cannot run on selected destination" error. Here's how I got my project to run.
Check under Build Settings > Architectures and set Architectures to Standard (armv7) or ${ARCHS_STANDARD_32_BIT} for all your profiles.
Set Base SDK to Latest iOS(<ios version #>) 5.1 in my case.
Set Build Active Architecture Only to NO for all profiles.
Set Valid Architectures to armv6 armv7 for all profiles. You may have to add either depending on what is already available.
Set iOS Deployment Target to iOS 5.1 (in my case) .
Make sure you have the same target under Deployment Target under the Summary tab of your project.
Clean and Run and cross fingers !!
In my case, the problem occurs after removing whole Resources folder, copying Resources folder from other or old project over current one then adding back that folder.
I solve the problem with the help from Analyse tool: after analysing, it warms me about Info.plist inside "Copy Bundle Resources".
Simply go to Copy Bundle Resource (at Build Phrase tab) delete Info.plist, then restart Xcode, clean and build. My project is back to normal.
Hope that help someones :)
I think a lot of these solutions force a full rebuild, which is what solved this for me.
I did Product => Clean, and the problem went away.
For me this worked:- Check all you product references are consistent in the settings and plists. Also check the product name does not contain any SPACE or other "illegal" characters.
try to rename your project. I solved by this way.
Judging from the responses this type of error has many potential sources, so here is my own (admittedly careless) version of the mistake (and simple solution):
XCode project Build Settings can be set at two levels: Project level, and Target level. For those less familiar, target level is where you have your executable app, and often other items like a dynamic library build.
In Linking section of Build Settings there is a option for Mach-O Type, where you can set Executable, Dynamic Library, Static Library, etc..
I was having trouble preparing a dynamic library, was scanning over the build settings for the project and saw Mach-O was blank. So I set to dynamic library. I then went on and reviewed a few more things and forgot I'd made this change. But I didn't realize I was at the overall Project Level, not the Target level for the actual dynamic library. This changed all target Mach-O settings to dynamic library.
And of course the executable target didn't like being treated as a dynamic library, and I got the OP's error message.
Setting the executable back to executable Mach-O at its target-level build settings fixed everything. Annoyingly the project-level setting still said dynamic library, but with correct target-level settings all worked fine.
Silly I know, but since a couple of the more drastic solutions listed above would have indirectly solved for this error I thought I'd share in case someone else had made the same mistake!
The way I solved this error was by a adding dummy function to my project. My issue was my app had no code of its own, only linked-in code.
I have an unusual situation with two projects: one "App" parent and one "Engine" child. All the compilable code is in the child and the parent simply links with the child, copying a ton of App-specific resources into the project.
Apparently this saddens Xcode, resulting in the above error.
My solution is adding this C function / file to the App project:
int workaround_for_xcode_reporting_cannot_run_on_selected_destination(){return 0;}
I restore the data from the time machine. Notice this is the exact same data that has been stored just 1 hour ago. The problem started yesterday. So it should be the EXACT same data.\
Yet it works.
I tried everything metioned here. Nothing worked. It seems that I somehow imported the Info.plist twice. To fix it I selected the project and pressed the "Validate Settings" button. Afterwards it works for me.
After a half day of experimenting, I think this means that the debugger can't find your executable to launch. I think this is an important distinction from the prior answers because its an underlying cause, that can have a lot of symptoms. In my case it couldn't reconcile the apps Info.plist for a custom build where we were copying the plist for the build. I changed the build setting to the Alt-Info.plist for AltDebug and that fixed it. Also meant no more copying.
Your underlying cause might be different, so the key takeaway is think about why Xcode might not be able to find your built app.
You'll be happy to know this problem has a very simple solution. Select Info.plist in your project navigator tree and make sure it is not assigned to a target. I have confirmed this is the correct solution. If building for iOS 6 or earlier you may also need to add armv6 to supported architectures
I had this issue after upgrading to Mountain Lion and XCode 4.4.1 for an OSX project.
To resolve it, I had to upgrade my deployment target to 10.5 or higher; it was set to 10.4 and up.
You have to find in the "Activity Monitor" the Xcode process and kill it! I just did it to solve a similar problem!
I've got this problem after accidentally removing the Resources folder, when I added it again to the project, Bam !
I'm also running Mountain Lion and XCode 4.4 !
trying to find out what's causing this, but it seems to be reproduced when you delete then add the info.plist file ! can someone confirm that ?
I had the same problem after two things happened:
I upgraded to Facebook SDK 3.1
I updated my OSX (with a minor version update)
The only fix worked from me was adding armv7s (mind the "s" in the end!!!)
Like was suggested here:
https://stackoverflow.com/a/12540654/531527
Yet another variant solution: after trying just about everything in the list above, I fixed this by addressing a warning that the TestFlightSDK1 path could not be found. To do so, I deleted the relevant path from Header Search Paths (Build Settings>Search Paths) and removed the TestFlightSDK, and now things run just fine.
I had this from beginning and it looks like it is a problem that the emulator can not handle virtual smartcards. Unfortunately I ended up just using my Android phone connected via USB.
Remove Info.plist from the Copy Bundle Resource build phase.That worked for me!

Resources