Xcode: No Scheme - xcode

I recently opened project in Xcode is now saying I have No Scheme:
When I try and Manage Schemes I am unable to Autocreate Schemes Now (a separate post but possibly related) and no Schemes are listed:
and when I try and add a Scheme I get dialog saying Target None.
What's going on and how do I fix my Xcode project?

Close Xcode and delete the folder <username>.xcuserdatad from within <projectname>.xcodeproj/xcuserdata/. Then restart Xcode, the schemes should re-appear.
EDIT:
You may need to delete from .xcodeproj file and .xcworkspace file

This worked for me
Click on No Scheme
Click on Manage Scheme
Click on Autocreate Schemes Now

I think this is happening when you are opening the app.xcworkspace not app.xcodeproj.
Solution:
Install the pod and open the app.xcworkspace again.

Close Xcode ["Force Quit Applications" (cmd+option+escape) to ensure]
Remove derived data of app (Xcode 9.4: Users/[username]/Library/Developer/Xcode/DerivedData/[app directory to delete])
Remove .xcworkspace from project directory
Also in project directory: .xcodeproj -> Right Click -> Show Package Contents -> remove .xcworkspace if exist -> xcuserdata -> remove [username].xcuserdatad
It should do the trick. Install pods if needed and open project. Target should be available again.

Use shortcut ctrl+cmd+[ or restart.

For me following worked
Go to your Project Directory and right click on the
.xcodeproj or .xcworkspace file and select Show Package Content
and delete xcuserdata.
don't forget to restart the Xcode
If it do not work and you have CocoPod in your project run the following Command
Pod install

The top answer fix didn't work for me when running the Xcode 8 beta's. but what did work was unplugging a connected device (iPhone, iPad etc.) and re plugging back in. The schemes would then reappear.

If you are using pods and using the correct workspace what I found to work best is simply open up terminal run pod update restart Xcode and every time it fixed the problem for me.

Firstly,when you are using Cocoapods to Develop iOS projects,you need to open the project with .xcodeworkspace file instead of .xcodeproj file.
Secondly you can Show Package Contents with .xcworkspace file,you will find the contents.xcworkspacedata file.
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:BluetoothColorLamp24G.xcodeproj">
</FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace>
pay attention to this line:
location = "group:BluetoothColorLamp24G.xcodeproj"
The .xcworkspace file has reference with the .xcodeproj file.
If you find there is no file or wrong path about the location,you can link to your .xcodeproj file,which works for me.
Development Environment:
macOS 10.14
Xcode 10.1

For me, I switched to a different Macbook. Running pod update fixed everything for me.

I will add to this answer::: From #Chris Miles.
Close Xcode and delete the folder <username>.xcuserdatad from within <projectname>.xcodeproj/xcuserdata/. Then restart Xcode, the schemes should re-appear.
Close Xcode, and everything, about ios development like simulators, then run again you pod install if you are using cocoa pods.
That's works for me.

This answer is for people who tried everything in the answers and still did not fix the issue:
Your solution is git checkout mainline. Because you probably played around with xcodeproj file and its broken now..

I have Removed pod completely from my project and adding it again.. retrieved my target and all

In my case the cause was renaming the project so I went to Manage Schemas and created the App Schema again (+ button).

In my case I missed }; in project.pbxproj after resolving conflicts

If you change the Major Name Change off/in your project in the past and after that deleted the Xcode and its data, You will see this issue. When You will clone this project on other device.You will see same issue.
To fix this, go to your pod file, update the target name and install the pods again.

None of the above worked for me. My solution was to look at the project file differences in text mode and I found that VALID_ARCHS got reset in two places (VALID_ARCHS = ""). Restoring the proper settings for VALID_ARCHS, also restored back the Schemes.

This commonly occurs when you install a Cocoapod, and try building and running from your workspace without first closing your project. If this is the case, quit Xcode, then open your app from your workspace and it should be fine.

In my case I rebranched to develop and then the window appeared if I want to resave my project. I must have clicked "close" though. Anyways, I lost my scheme and what helped was rebranching to some other branch, then back to develop and resave how I was supposed to do in the first place

Try this very simple steps:
Xcode menu "Product"
Scheme
Select another scheme

Related

Xcode indexing does not finish

I am having a small project just for testing. After a few days of testing the "indexing process" of Xcode broke, it simply does not finish. I tried it with another project, same thing. I tried to reinstall Xcode -> Did not help, I deleted the Derived Data -> Did not help. Restarting Mac + Xcode -> Did not help. Is there anything else I could try ? Thanks for every tip, this problem really kills the dev process.
Apparently the following has worked for several people.... Hope it helps you! PS:I'm trying it right now
Open your Project Folder.
Find ProjectName.xcodeproj file.
Right-Click Copy and Paste to Safe Place.
Right-Click Show Package Contents.
Find project.xcworkspace file and delete that file.
Reopen Your Project and clean and Rebuild.
If your problem is not solved than replace the file with your backup file.
In my case, I solved that problem by just closing assistance editor and selecting another source file in Xcode. It was useless to empty /DerivedData folder, cleaning project, rebooting OS or reverting to the previous project. After closing assistance editor and selecting another source file in the project navigator, Xcode successfully completed the indexing. Before then I opened Info.plist with viewController.m source file in Assistance Editor. My Xcode version is 9.4.1.

Xcode 4.2 Product -> Run Greyed Out

My "Run" button under "Product" is greyed out and after trying a few things from various forums, can't figure out what's gone wrong.
I've tried removing the project.xcworkspace and xcuserdata files and letting xcode generate new ones, but no...
My co-worker uses AppCode from IntelliJ and when he pulls the code, it runs just fine. But if he opens the same files in his Xcode, his "Run" is also greyed out.
"Edit" your current "Scheme":
Make sure you have "Run" checked for that build target:
The scheme need to be fixed (I don't know why xcode changed it)
Here are the required steps:
, ,
Make sure you have the correct target selected.
(Upper-left in Xcode window, near the triangular Run button.)
My co-worker who uses AppCode had edited the configuration file, moved some frameworks around, etc... We noticed that there was a difference between XCode and AppCode in using relative vs. absolute paths in the project.pbxproj file.
Ultimately I just reverted the code to before his changes, so at this stage, I'm not entirely sure which difference in the config file actually caused Xcode to not be able to Run the project.
**EDIT
From the .git logs, it looks like AppCode was adding relative directories with 7 sets of "/../" and before there were only ever instances of 5 "/../" to get back to the root directory.
Rather frustrating that Xcode had no way of dealing with this from inside the IDE.

iOS5 Storyboard error: Storyboards are unavailable on iOS 4.3 and prior

I've built a small app using storyboards and it ran great. Just before final testing I decided to try it out to see if it runs on iOS 4.3. I clicked on the gray 5.0 in the project settings and selected 4.3.
The app failed to build with the following error message:
Storyboards are unavailable on iOS 4.3 and prior
Both the iPhone and iPad storyboards tell me that.
The issue that when I switched back to iOS5 target, I still keep getting these errors from both storyboards, and the product won't build!
I checked: iOS Deployment target in projects settings is 5.0
Target app deployment target is 5.0
Build settings uses iOS 5.0 SDK
What else do I need to do to restore my project to a buildable state? Is this a brand new bug or am I forgetting something?
Update: I kept getting this error even after doing a clean.
I changed the debugger in Schemes to "LLDB" and did an additional clean, the project now builds and compiles
I also got this problem and finally I solved this by following procedure:
Open XXXXXX.storyboard
Open Identity and Type tab in your right view of Xcode.
Set the value of Development in Document Versioning to "Xcode 4.2" (my default value is "Default Version (Xcode 4.1)".
Change the value of Deployment from Project SDK Version (iOS 5.0) to iOS 5.0, then back to Project SDK Version (iOS 5.0)
Rebuild the project and the error should be resolved.
The solution that worked for me was just to delete the ~/Library/Developer/Xcode/DerivedData directory for my project.
I'm just going to add this one as another possible answer here, as the first solutions worked for me several times (as I mentioned in my previous comment) until today when I couldn't get my project to compile for love nor money with the same error.
With the debugger changed and Xcode set to 4.2 and restarting several times I could not compile. However I discovered another way to get around this issue.
Select the storyboard in the left column and 'Show in Finder' and drag the storyboard to the desktop. Xcode will now change its colour to red and be unable to compile.
Clean the project, drag the storyboard back from the desktop to the directory in finder.
Then, it builds and the error goes away again.
I don't know what triggered the error originally as I'm developing under iOS5 and building for 4.3, but it seems to come up from time to time and.
This seems to be a bug in the latest XCode that I've also run into too, did try the OP's solution of changing debugger and that had no effect.
It cropped up for me since I tried storyboard with 4.3 and then tried to change back.
My solution was to close XCode, open it again and clean. Then I compiled and it worked fine.
Hope this helps others.
While other solutions helped me, they didn't work 100% of the time. I don't know enough about XCode to know how reliable this solution is, but at least it worked for me so you can try it in your project.
In the left hand side of Xcode, open the project navigator. Click the top item, which is your project. In the panel immediately to the right, you'll see a choice to choose between your project and its targets. Click the project, and then in the panel to the right, under the "Info" tab, set "Command-line builds use" to Debug (in my two projects where I was having the error, both were set to Release).
A picture is probably easiest:
Another idea: Open another project with storyboards in Xcode and try to run that. If it succeeds, you can come back to the current project and it should build. I think this clearly indicates a bug in Xcode.
After trying all the answers in here (removing the Storyboard reference, quitting Xcode, cleaning, changing debugger, etc.), none worked (with Xcode 4.5).
The only way I got it to rebuild (and it was a total guess) was to open the Storyboard file in a text editor and delete the following line:
<deployment version="1280" identifier="iOS"/>
It should be near the top of the file, in the <dependencies> section. After that, the project was built successfully and Xcode even re-added that line to the file, but, it still builds...
Go figure...! Hopefully it can help someone!
At last, an elegant workaround that seems to do the trick for me! (I sure hope it works for everyone else. This one's stubborn.)
Once your settings are back safely in iOS 5-land, try Cmd-Option-Shift K (aka "Clean Build Folder..." from the menu - hold down Option to see it), then build.
the solution is simple,
right click your storyboard file, and show in finder
then select the folder where the file is (this would probably be in the en.lproj folder)
right click on the MainStoryboard.storyboard file causing the problem and open with text edit
find the line that reads or something like this:
<development version="4300" defaultVersion="4200" identifier="xcode"/>
and change it to something like this:
<development defaultVersion="4300" identifier="xcode"/>
save the file and build. Et voila...
Ok, I tried everything above and problem still occurred. So I just remove storyboards (as reference not move to trash). then build successfully; after that I added them again; Build, And finally worked.
I was having the same problem. I tried all the above answers and all combinations and nothing worked. Then later after doing some research, I analysed that the simple fact that the error that was throwing at me was straight forward.
Just go to the Build settings and instead of selecting the xcode project file, select the product file and change the Deployment target to 5.0 or 5.1. The error should go off.! I did this in Xcode 4.3 in Lion OSX. It worked fine for me!!
I also had this problem, and nothing helped. Even opening another project and trying to build failed.
What I did, and what for me, was going to project -> info and under "Deployment Target" change iOS Deployment Target to whatever, build and than change back to whatever it was and build again.
Here is yet another random, voodoo, flail that seemed to workaround the bug just now. (after other techniques here had not helped) I renamed the storyboard file (and the entry for it in the info.plist file). Haven't tried the "drag to/from desktop" ritual yet.
Tonight, I have lost like 45 minutes to this issue. grrrrr. Ok I feel better now.
After trying all the suggestions above, without success, I got my code to compile doing the following.
Edit -> Refactor -> Convert to Objective-C ARC
rm -rf $HOME/Library/Application Support/Developer/Shared/Xcode
rm -rf $HOME/Library/Preferences/com.apple.dt.Xcode.*
rm -rf $HOME/Library/Saved\ Application\ State/com.apple.dt.Xcode.savedState
rm -rf $HOME/Library/Developer/Xcode
seems to help with Xcode 4.3.2
Had similar issue. XCode would build and run other projects fine but couldn't get rid of the error on project I had changed, not even backups from server. Tried all the above solutions but nada. Here is what worked.
Uninstall XCode.
Delete user/library/developer/XCode folder.
Reinstall XCode (maybe you should start this before searching for the folder, download took me 20 minutes).
Start up, clean and build.
Worked for me. Saved me some time. Sometimes when the scalpel doesn't work it's time for the hatchet. Now I get to pick a new font to code in (this will clear your preferences)!
The only solution that has worked for me is to create another project without Storyboarding enabled, build it, then switch back to the storyboard project, clean and build.
Here is yet another random, voodoo, disconnect your iPhone if it is connected.
I simple changed deployment target to 4.0 and Development to 4.3 from MainStroyboard.
I clean the project; and restarted the mac, :) i know it sounds funny but restarting xcode didn't helped. maybe there is a cache in memory...
Then i built the project ; it was ok!

Xcode 4.0.1 "Don't have permission to view" Old project file - Help!

I recently upgraded to Xcode 4.0.1 from the last version of Xcode 3x (not sure which). Install went fine and I can open and view all my old .xcodeproj files without problems. All except one!
The error I get inside Xcode is
"The file "GCSCalculator.xcodeproj" couldn't be opened because you don't have permission to view it. To view or change permissions, select the item in the Finder and choose File > Get info."
Obviously I've checked that and the permissions are exactly the same for all files as the ones in the projects that do open in Xcode. I changed permissions for everyone to ReadWrite just in case, to no avail. I feel I've tried everything obvious and can't seem to find anybody else with the same problem.
Anyone got any ideas about a fix or workaround? Typically it was one of the only projects that was actually completed so its very frustrating!
Thanks.
I ran into the same problem and found that clicking on the project in xcode and then switching the view to standard editor view will let you change all of the project settings. After editing the summary, info, and build settings areas it started working
Click to project-> Build Settings -> Compiler for C/C++/Objective-C -> Default Compiler. Hope it useful :D

Xcode Crashing When Opening Project File

Xcode keeps crashing on me when I open my project file. I've been able to open it fine for weeks now. Not sure how to diagnose. It only crashes for a specific project.
Process: Xcode [1293]
Path: /Developer/Applications/Xcode.app/Contents/MacOS/Xcode
Identifier: com.apple.Xcode
Version: 3.2.5 (1760)
Build Info: DevToolsIDE-17600000~5
Code Type: X86-64 (Native)
Parent Process: launchd [189]
Date/Time: 2010-12-15 16:05:24.659 -0700
OS Version: Mac OS X 10.6.5 (10H574)
Report Version: 6
Interval Since Last Report: 201 sec
Crashes Since Last Report: 4
Per-App Interval Since Last Report: 80 sec
Per-App Crashes Since Last Report: 4
Anonymous UUID: 2B7F7CFC-45EA-450C-8467-6BF1E356B6F6
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000025940
Crashed Thread: 10 Dispatch queue: com.apple.Xcode.index-access
Application Specific Information:
objc[1293]: garbage collection is ON
The crash is generally a sign the project file has been corrupted. Here's a list of possible things you can do to try to fix it.
1. Fix a corrupted *.pbxproj file
Caused by a merge conflict
If you are using version control, it might be caused by a merge conflict that has not yet been resolved.
Using Finder, open the directory that holds your project.
Right click the project file YOUR_PROJECT_NAME.xcodeproj and Open With your preferred text editing tool such as Sublime Text.
Look for merge conflicts which are usually marked using a series of ========= bars.
Resolve the merge conflicts manually or remove the changes of one side.
Caused by unreadable XML
If that fails go into the file and quickly scroll through to see if anything seems out of place - it should generally be readable XML. You could even try an XML validator against it to see if anything amiss was found.
2. Reset your workspace
Using Finder, open the directory that holds yor project.
Right click the project file MyProject.xcodeproj and choose Show Package Contents.
Delete the xcuserdata folder, which should contain a folder with your username on it.
Repeats step 2 and 3 for your workspace file MyProject.workspace
As elaborated by KennyWinker and Paul R on the answers below.
3. Recreate your Xcode project
Note that this should be your last resort as it is quite tedious to do for large projects.
Lastly you could simply re-create it. That might seem like a big pain, but basically you could just create a new project and drag everything under the "Classes" folder into Xcode to start using it (don't forget to also add the frameworks you need).
Just wanted to elucidate on #Paul R's comment.
I had a situation where Xcode was crashing every time I opened a project file. It seemed to be connect to the IB window that was opening. In the end it was deleting the contents of MyProject.xcodeproj/project.xcworkspace/xcuserdata/ that solved this. It did this by resetting the workspace (open files, window scaling, etc.)
Hope this is helpful.
What worked for me?
The only solution that worked for me was deleting the derived data folders of the hanging project, i.e the derived data folders in above directory: ~/Library/Developer/Xcode/DerivedData/. Hope it helps someone.
What didn't?
As mentioned at other places, deleting MyProject.xcodeproj/project.xcworkspace/xcuserdata/ or MyProject.xcodeproj/xcuserdata/ didn't work for me.
Just wanted add some extra content to #Kenny Winker answer...
To delete your xcode user data go,
Find your Xcode project file ex: MyProject.xcodeproj or MyProject.xcworkspace
Right click on it and choose Show Package Contents
Finally, just delete everything inside the folder xcuserdata
Done! :)
Hopefully, this adds a bit more context to people who doesn't know where to find their project user data.
I had similar problem with Xcode 8.1. The reason maybe the project file contains merge conflict data.
You can remove this by opening Xcode project file in TextEdit.
However, in my case there was no merge conflict. Simply deleting content of DerivedData worked for me.
Steps :
Open finder window then select Go Tab -> Go to Folder… (or press Cmd + shift + G)
Enter ~/Library and press Go. This opens Library folder which is hidden by default.
Go to Developer -> Xcode -> DerivedData folder. Delete all the content of this folder.
The DerivedData is like cache i.e. create every time you build/run your app.
Now open the project. It should work with no issues.
Copying Answer of #Sean D which worked for me.
After seeing a suggestion here, I solved this issue by deleting Xcode's preferences. The most reliable way to do that is the following terminal command, issued after quitting Xcode:
defaults delete com.apple.dt.Xcode
ETA: Other suggestions have involved changing or removing certain individual preference settings, but after trying a few of those, none worked for me. There seem to be multiple incompatibilities in the preferences between 6 and 7b3, so trashing the prefs entirely should work around them all.
I did every solution on the thread. But nothing helped me. Don't know why.
Instead of opening the project through Xcode, I opened the project through the terminal using open Project.xcworkspace, it magically works.
Same thing happened to me, and it was some sort of versioning issue that I couldn't fix, so I reverted back to a prior version and it worked. Feels like there are a few bugs in XCode 4 that still need to be worked out.
Inside your project folder find projectName.xcodeproj or projectName.xcworkspace if you have installed pods right click on it and click on (Show package contents) and finally delete everything inside xcuserdata folder
Launch your project it will work fine
I had XCode crashing every time I opened Images.xcassets. The solution was to delete a corrupt PDF file I had just added.
Computer restart
worked for me. While
xcuserdata deletion
and
defaults delete com.apple.dt.Xcode
didn't work for me.
I even was not able to open xcode alone or any of my projects or single .m file.
I was also facing same issue, I did every things like below but didn't work for me!
Deleting the derived data:
~/Library/Developer/Xcode/DerivedData/
Delete everything inside the folder xcuserdata:
MyProject.xcodeproj/project.xcworkspace/xcuserdata/
and
MyProject.xcodeproj/xcuserdata/
What worked for me?
In my case I have reinstalled Additional Component(Additional downloads) from below link then solved this issue.
https://developer.apple.com/xcode/resources/
If you have any open swift file in a new window (for example when you double click on a .swift file in xCode and it opens in a new window) when xCode opens this might be an issue. I think I had this window opened when closing xCode, then when opening xCode this window opens up again and for some reason crashes xCode. Try to close that open window quickly before it crashes. Strange, but that worked for me.
i tested a lot of ways but after of all i just and only change the directory of my project location every thing fixed and my Xcode works properly and I'm glad now....
I experienced XCode crashing when trying to edit a specific original.m file. None of the above solutions worked, but this did:
Create a new .m file as new.m for example.
Using a text editor open up original.m outside XCode, copy contents and paste into new.m inside XCode. Go back to working in XCode.
Delete and move to trash the original.m
Rename new.m to original.m
Now I can edit original.m without XCode crashing.
In my case there were two windows, one on the internal screen of my MacBook and one on an external each with several tabs opened before Xcode crashed and kept crashing on trying to open the xcworkspace file. The above mentioned solutions did not work. After disconnecting the external display, Xcode started without crashing and both windows were placed on the MacBook's screen. Reattached the display and everything worked as before.
I you use Cocoapods try pod deintegrate, delete the workspace, then pod install. This cured it here (Talking of Xcode 11.2.1 after upgrading the Mac to Catalina and the following crashing Xcode)
Towards a cocoa pods included project, I resolved this issue by renaming workspace file and running "pod install" on terminal again.
I was also facing same issue, everytime xcode was crashing. i restarted mac, cleared derived data/xcuserdata but nothing worked.
I had one more repo so i copied 'project.xcodeproj' file from there and paste it in current repo, this trick resolved my problem.
Go to project -> right click on .xcodeproj -> show package contents -> delete all files in xcuserdata.
Quit the xcode -> reopen
Delete the
Open project in previous version of Xcode and then close it and reopen it on Xcode version that you are using for project,
suppose you are using Xcode 11.1 and it is getting crashed while opening projects, then open it in Xcode 10.0 or 10.1.
Fix a corrupted *.pbxproj file
Reset your workspace
defaults delete com.apple.dt.Xcode
do 1~3 and
git clone ~~~.git newGitProject
copy MyProject.xcodeproj, MyProject.xcworkspace
go to GitProject
paste MyProject.xcodeproj, MyProject.xcworkspace
worked for me.
if you have git repository , try it ;)

Resources