Xcode quits unexpectedly every time I open my project
Asked Answered
D

16

59

After opening xcode, when I open my current project, it's showing a warning like "xcode quit unexpectedly" with 3 options: "Ignore", "Report" and "Reopen". When I click "Reopen", it will open the xcode window and again automatically it will close and show the same warning.

Why this is happening? If I open any other projects, then it opens with no issues; the issue is with my current app.

versions:

  • xcode is 4.3.1
  • mac OS X version is 10.7.3

Please tell me why it's happening like this.

Drusilladrusus answered 28/11, 2012 at 7:34 Comment(3)
rewove all user data from the project and try again. also, provide some error message - otherwise no one will be able to help you.Hydrops
Try deleting DerivedData folder of your Current App. It should be located somewhere in ~/Library/Developer/Xcode/DerivedData/CurrentApp-{some generated string}/Hereld
I tried this but no result ..Same problem...shal i post problem report??Drusilladrusus
Z
153

Xcode stores some user state information inside the Xcode project “file”, which is really a folder. That state information might have become corrupted. You can normally throw away everything inside your .xcodeproj folder except the project.pbxproj file. This might fix your problem.

Open up the folder containing your .xcodeproj file. Right-click or control-click the .xcodeproj file and choose “Show Package Contents”. Then throw away everything except the project.pbxproj file.

cleaning an xcodeproj package

If you know what an Xcode workspace is, and you're actually making use of it, you might not have a project.xcworkspace file to throw away, or you might not want to throw it away. But if you don't know what an Xcode workspace is, then you're not using it so you can just throw away project.xcworkspace. Xcode will recreate it automatically.

Zug answered 28/11, 2012 at 8:10 Comment(7)
You are the man ! I personaly went on biogaran.xcworkspace and removed the folder xcuserdataBoote
Nice graphic but this didn't fix it for me-!! My issue was xcodes built in version control - solved by https://mcmap.net/q/330756/-xcode-5-crashes-xcode-quit-unexpectedlyMeaningful
Its not solving my problem yet. i am able to open xcode 8 but in xcode 7 still getting same alert again and again.Awoke
After doing this I had recreate my build schemes in order to build and run.Tonie
I was using a workspace - did the same thing on my .workspace file and it worked :)Akers
Deleting just UserInterfaceState.xcuserstate file fixed the issueSibelius
It might also help to download a fresh git clone of the project - if the xcuserdata etc are ignored, you should get a clean version. helped here.Twylatwyman
W
19

Deleting Derived Data worked for me. Just open another project or open xcode without opening your corrupted project. Than open preferences and go locations tab at the end. Click gray circle with arrow (where all your projects derived data are saved.)enter image description here

Delete your corrupted project's derived data in there and you are good to go.

Waadt answered 8/2, 2017 at 7:52 Comment(1)
worked for me as well, thanks! Deleting files in *.xcodeproj directory did not work for me.Timorous
C
7

you can run XcodeSystemResources.pkg.

/Applications/Xcode.app/Contents/Resources/Packages/XcodeSystemResources.pkg.

I hope help to you

Calumny answered 23/10, 2017 at 8:7 Comment(0)
D
6

go to [ProjectName].xcworkspace file.Right click. Show package contents. Delete xcuserdata folder. After deleting, run the project it will work for sure.

Dissepiment answered 11/12, 2019 at 9:4 Comment(0)
R
5

I would recommend opening the terminal and copying in the following:

rm -rf ~/Library/Developer/Xcode/DerivedData

Note: credit to zirinisp for providing the answer that worked for me

Rewrite answered 12/5, 2017 at 10:35 Comment(0)
L
3

Just delete the Xcode saved state. It worked for me.

Laurilaurianne answered 6/2, 2013 at 10:45 Comment(0)
A
2

I am using CocoaPod (XCode 8.2), these steps solved my issue:

  1. Go to project folder
  2. Open package contents of .xcworkspace
  3. Delete xcuserdata in package contents
  4. Remove it from Trash (optional)
  5. Go back and open .xcworkspace (XCode will prompt to reopen, but don't do this)
  6. Continue with your project :)
Atlee answered 23/6, 2017 at 6:14 Comment(0)
D
2

Open project folder show package contents from .xcworkspace or .xcodeproj You will see 2 folders xcshareddata and xcuserdata Please remove xcuserdata folder Try to open application

Delegate answered 21/11, 2019 at 10:32 Comment(0)
C
2

My Solved that worked

  1. Go to project folder
  2. open package contents of .xcodeproject
  3. Delete xcuserdata in package contents
  4. Go back and delete .xcworkspace

/// Please dont delete .pbxproj

Try to open your project and work :)

Clea answered 13/3, 2020 at 9:24 Comment(0)
L
1

If you're using CocoaPods, just follow Rob's instruction but on the .xcworkspace file instead and do not delete the .xcworkspacedata file.

Lorettalorette answered 30/3, 2017 at 12:37 Comment(1)
You're right but they can make clean cocoapods installation if it is necessary.Reverberatory
R
1

It's 2021, still having this problem. Reboot doesn't help, OS update doesn't help.

Then I updated everything in the App Store (iMovie, Numbers, Pages, Keynote) and Xcode is now working.

Please don't ask why.

Resolutive answered 11/3, 2021 at 11:5 Comment(0)
C
0

I am using CocoaPods, and followed Rob's Instruction on the .xcworkspace file as indicated above by Allecto. After I "showed Package Contents" on the .xcworkspace file, the only thing I did was to rename the xcuserdata folder to xcuserdataCrashApril2. I was then able to open the project (workspace) with no problems. The only difference is xcode did not save the state of which .swift source code files were previously opened (which is not a big issue for me).

I suppose I can delete the xcuserdataCrashApril2 file, but I am keeping it out there as a reminder of what to do the next time this happens.

Chun answered 2/4, 2017 at 9:30 Comment(0)
K
0

I am using Xcode 8.3

Go to ~/Library/Developer/Xcode

Delete Derived Data folder and it works for me.

May help you.

Kor answered 25/9, 2017 at 18:39 Comment(0)
S
0

All the advices from above didn't help me so I added the pod file via pod init & pod install and successfully opened newly created .xcworkspace. Hope it helps somebody

Scotney answered 4/11, 2017 at 13:14 Comment(0)
D
0

I also have this bug with XCode 10.3. In my case i launch app -> it displays alert "Quits unexpectedly" and it doesn't matter what i choose: to reopen or not - it crashes again.

Solution: Reboot Mac :))

Dympha answered 28/11, 2019 at 13:25 Comment(0)
G
0
  1. Delete Project.xcworkspace first.
  2. Open Terminal
  3. Go to application folder
  4. Run command pod install
  5. Delete Derived Data
  6. Open Project.xcworkspace

It works for me.

Givens answered 18/2, 2020 at 5:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.