Xcode - Deleted derived data and screwed up the frameworks - xcode

I deleted the derived data and my frameworks are now messed up. Even though I removed and reinstalled the pod, xcworkspace simply refuses to detect it, worse it no longer creates the links and now it's all in red.
Really at a loss here.
Sorry if this seems like a stupid question but I'm self taught.
Latest update: I managed to get the app running again by changing "Build Active Architecture Only" from NO to YES. Not sure if this is the right way to do things but it works for me.
Still the frameworks are in red and I am worried Apple will not accept this project for it's store.
Anyone can help me with fixing it?
Progress # Day 2

Related

Opening Storyboard fails with "An internal error occurred. Editing functionality may be limited"

Im running Xcode 9.2. My storyboards are completely useless now. Ive
experienced what this article shows and have tried everything the
article suggested.
My issue occurred when I tried to add a single swift file to an existing
objective C project with about 320 files in it already. I removed the
.swift file entirely from the project, then did everything in the article
link above and still nothing fixed it including removing/reloading XCode
several times trying different things.
I filed a bug with apple but haven't received any replies in a week (of course). Apple seems to be slammed with tons of bugs lately they keep
creating.
Now I cannot work on this project's storyboards at all and Im dead in the
water. Really not happy with Apple lately!
Is there anything more that anyone has had success in fixing this issue?
Im completely dead in the water on this application now.
Fixed this by setting the command line tools version to the correct one. Mine was blank in Preferences / Locations
For my case, whenever I open a storyboard from a workspace, this happens. So I got rid of cocoapods and workspace, then just use carthage for thirdparty libraries. Storyboards opens faster and without this error.
Note that the storyboard I am testing is empty.
This turned out to be stupidity on my part. I had a script that was killing certain processes on my Mac over and over and it turns out that was my issue. When I removed it everything worked as normal again.

Opening StoryBoard in XCode automatically adds ~100 auto layout warnings when I open a project and they won't go away when I click "Update Frames"

This might be hard to diagnose without seeing the project, but Xcode keeps adding tons of warnings to my storyboard. It is a source controlled project, and if a team member cleans up all the warnings, pushes, and I pull, the warnings go away but as soon as I open storyboard, they reappear and they do not go away when I do the standard Update Frames option.
A lot of them seem to have to do with Stackviews, but I'm just confused why my coworkers can get the warnings to disappear and I cannot.
Has anyone experienced anything like this, or have any tips on how to approach solving this?
I was using Xcode 7.3 but after updating to 7.3.1 the problem still persists. Running OS X 10.11.6
Edit: Just to add some specifics, when I look at the source code versus my local code, it basically adds a ton of "Misplaced" tags, and a lot of values are changed by 0.5 or 1 pixel.
I do have the exact same issue when working with others on the same storyboard. It will happen every time you open (or another colleague) the storyboard. Here are some advises to avoid this :
When I open the storyboard, I know it will provoke this warnings. So if I don't add anything, before pushing a new commit, I reset any changes on the storyboard
I've come up with another good solution : using storyboard references as much as I can. So what I do is basically creating a storyboard for every flows (sometimes you can even have one storyboard for one controller). That way, when I work on a part of a project, it won't generate warnings on the totality of the storyboard. It avoids epic merge with many conflicts, it is easier to maintain, and it's faster to work on a small storyboard than on a huge one (Xcode is powerful, but when you have big storyboard, at a certain point it will lag).
But to answer to your question, I think everyone have that same issue when working on big projects, hopefuly apple will solve that one day, but for the moment you have to set good practices with your team. This is the only way to avoid wasting time at every pull ;) (at least for me, maybe someone has a better solution).

Xcode 6.4 crashes in Swift breakpoint

In one project I'm using I can't set breakpoints in Swift code, Xcode always crashes when reaching one of them, doesn't matter if it's a "manual" or an exception breakpoint.
In other projects everything works as expected, only for one project Xcode 6.4 (6E35b) always crashes.
I tried cleaning, deleting derived data, resetting simulator, restarting Xcode/Mac - nothing helped at all.
Anyone else experiencing this problem and hopefully knows what helps?
EDIT
Seems only to be the case on one machine (Xcode 6.4, 10.10.5), but not on the other (Xcode 6.4, El Capitan). But as I mentioned in the comments, reinstalling Xcode didn't help, are there some other preferences I could reset/delete?
EDIT2
Here's the Xcode crash log file:
https://dl.dropboxusercontent.com/u/119600/Xcode_2015-08-12-074655_Stefans-iMac.crash
I would try uninstalling and reinstalling Xcode to see if it helps... I've heard of successes with this technique for similar issues.
Just delete the entire Xcode.app from /Applications, and reinstall from the .dmg. If you're not certain of the binaries and have time / bandwidth, consider re-downloading the .dmg.
If that doesn't work, try the following source control tricks (substitute "your favorite revision control" for "git"):
Try purging all objects not in source code control
Another approach: Check out the app again into a fresh repository (this will get even the files that may have been committed but ignored later).
If not under source code control, grab a .gitignore from here and add it to git, then check out into another directory (this will leave everything but source, interface builder, project files and resources/assets behind).
I'd suggest moving the breakpoint code to another location (such as making a function call and breaking either before or inside the function). However, if all Swift code has this problem, that may not work.
Finally, after making an interim commit (to roll back to), try it in Xcode 7 beta. Bit of a hassle because you have to upgrade to Swift 2.0, but if you keep the deployment target the same no iOS target changes are needed.
If this really is a burden and/or it's a small project, you could try creating a new project and migrating the files and storyboard over, but likely this is too much effort.
Either way, since you note it's pretty much all breakpoints in Swift code, file a bug with Apple's bug reporter. They really need to hear about issues such as this, since you don't seem to be alone in having this issue.
EDIT: Where are others seeing this issue?
Maybe we can see commonality -- since this is only reported in Swift projects (so far). A colleague has seen this problem with breakpoints (as well as stepping through code) in Xcode 6.4 on 10.10.4. (I've seen Xcode 6.4 crashes in the past as well).
I see OS version 10.10.5 mentioned as a target where this happens (#swalkner); is this a beta? If OS 10.10.4/5 is the only place we see this, it might be significant. If it's a project/OS interaction, it might be tricky to reproduce / fix, but I'd encourage everyone to submit detailed bug reports to Apple (maybe even link this post).
Some points to note if you're seeing this:
Operating System Version
Hardware
Target: Simulator vs. Hardware; iOS vs WatchKit app.
Target SDK version(s)
Swift only? Or on an Objective-C only project? Mixed?
Only one project, or several?
It's a longshot, but let me know if it's working:
uncheck the "Always show Dissasembly" check
Debug > Debug Workflow > Always Show Disassembly
In older versions of Xcode (<6.1):
Product > Debug Workflow > Show Disassembly When Debugging
I've just spent the past few hours trying to solve exactly the same issue.
I thought at first, it had started due to installing Xcode 7 on the same machine as Xcode 6.4. The problem certainly coincided.
However, due to having version control, I could look and see what files had changed since opening the project with Xcode 7.
The images.xcassets file had changed. Reverting this file back has stopped Xcode from crashing each time it hit a breakpoint.
I'm not sure whether this helps at all, but definitely look at images.xcassets and if needs be, delete it, recreate it and ensure it's setup 100%. It certainly fixed my issue.

AppleScriptObjc - Xcode 4.6.3 - Xcode No Longer Recognizes Created Outlets or Actions

Okay, log time reader, first time writer.
!!! NOTE: While reading this question, please bear in mind I am writing using AppleScript in a fresh Cocoa-Applescript project. I am NOT using straight Cocoa/Objective-C. !!!
With that out of the way.
I have been using Xcode and ASObjC for a while now and have developed quite a few productivity apps for myself, so I have a pretty good idea as to what I am doing and how it is supposed to work. However, this issue has me pulling my hair out!
A few weeks ago, I updated to OSX 10.8.4 (this is when I believe the issue started). Since then, Xcode no longer recognizes any outlets or actions I define in my AppDelegate file.
Here is an image illustrating the issue:
http://cl.ly/image/0a1b1T1O1O1m
"theLabel" should show under Referencing Outlets and "doAction" should show under Received Actions
This is especially strange when viewing projects created before the issue:
http://cl.ly/image/3J0m2a2q392r
The "!" to the right of each outlet states: AppDelegate does not have an Outlet named [outlet name] The Actions have a similar warning message.
I have done some Troubleshooting on the issue with no success.
Restarted Xcode - issue persists
created fresh project - issue persists
pulled all .plist files related to Xcode - issue persists
trashed DerivedData folder - issue persists
removed and reinstalled from App Store - issue persists
created fresh user account and project - issue persists
reset NVRAM - issue persists
tried on different computer - issue resolved
Issue seems to be isolated to this machine.
If anyone can help me with this, that would be awesome. Maybe I am just missing something important.
I'm usng OS X version 10.8.4 with Xcode 4.6.2.
I tried out what you said.
I made a new AppleScriptObjC project from the Xcode template with document-based application set to false, so Xcode create a new project for me with an AppDelegate.
I got the actions for the AppDelegate class to work both tying menu-items to First Responder and tying them directly to the AppDelegate.
I tried changing the name of the app delegate to "ThisIsTheDelegate". This didn't work until I also changed the name of the AppDelegate class to be "ThisIsTheDelegate" in Xcode's identify inspector.
I don't know if this is the problem that you are having or not.
You wrote in your original question that:
tried on different computer - issue resolved
So it must be something about your configuration.
When I first tried AppleScriptObjC in Xcode, I got some errors that were resolved on my computer by removing some osax files from
/Library/ScriptingAdditions
I don't know if this is the problem that you are having, but I removed them all and stashed them somewhere else for safe-keeping in case I needed them, and I haven't needed them yet.
I believe that these .osax scripting additions were installed by a third-party, namely Smile and Satimage.
I understand that there is some good functionality in these scripting additions, but Apple recommends that third-party developers don't even develop .osax scripting additions because they as so global.
What's better is to use Scripting Agents which are apps that aren't even in the picture unless you give them a tell command.
That's all that I can think of.

How to disable Interface Builder document versioning from auto updating?

This question is still getting a lot of upvotes. So look at Update3. once you have upvoted, commented, answered, please please please file a radar
Viewing a nib / xib, modifies the file, forcing me to either commit the change or undo the change. This is not an issue, until there are merge conflicts.
Detail:
I work in a team of 5 iOS developers, and the last few versions of XCode, we are experiencing an issue with the .xib / nib files getting touched / modified when anyone opens the file (without making any changes).
If one developer thinks "screw it, let me checkin whatever modifications xcode does" and checks it in, it doesn't stop there. the same file on two different machines (with the same version of XCode and MacOS) will again be touched/modified when another developer views that nib.
The thing that usually gets modified in the .xib file is this
<key>com.apple.ibtool.document.version-history</key>
<dict>
<key>interface-builder-version</key>
<dict>
<key>com.apple.InterfaceBuilderKit</key>
<string>2844</string>
<key>macosx.version</key>
<string>12C60</string>
</dict>
</dict>
<key>com.apple.ibtool.document.warnings</key>
<dict/>
But other than that it also modifies or moves around existing key-value pairs within the .xib file.
I have searched a lot on SO and Google, and I haven't seen many posts about this issue.
I had a nightmare of a merge conflicts when I upgraded all nibs to handle the iPhone5 screen, which in itself wasn't too complicated, but got a ton of merge conflicts due to the document versioning.
Deleting code I didn't understand, led to xcode crashing when I tried opening the nib. (I have fixed this for now, by reverting to what it was earlier)
Any advice on how to avoid this issue, is appreciated!
Update: Have noticed that this is not resolved yet, and still getting upvotes quite often. I am just curious, do any of the storyboard projects experience the same issue? (I haven't worked on storyboards yet).
Update2: To all those who are experiencing the same issue, please file a Radar even if you get a response saying there is an existing radar. it helps bubble the issue to the top and the gods of XCode will address it only then.
Update3: I still see quite a few upvotes on this thread, and the apple bug report is still open. So, after upvoting this question, please file a radar, with details I have mentioned in the question (and/or add your own explanation)
Update4: This question is still getting a lot of upvotes. So look at Update3. once you have upvoted, commented, answered, please please please file a radar
Update5: Per info from Apple Engineers at WWDC 2014, this issue has been fixed in Xcode6. I'll update this question (and probably close it) once I confirm that this has been fixed.
Update6: Hoping to see this fixed. Will be asking this at WWDC2015 (through someone I know who's going there). Would be great if the other lucky ones who got a WWDC ticket can also do the same at WWDC 2015
Update7: Xcode 7 is here, and so is this bug :( The original radar report (11533872) is still open
Version 4.6.3 of Xcode resolves this issue. However, as the comments state, you all need to be running that same version. If four developers are on 4.6.3, and one is on a previous version, then that developer will experience the same issue. However, if they do not commit that change then it will not affect the others.
The two Xib keys affected are:
<string key="IBDocument.AppKitVersion">1187.39</string>
<string key="IBDocument.SystemVersion">12E55</string>
So, bottom line, get everyone on the team to update to Xcode 4.6.3.
Try updating the XIB's "Document Versioning: Development" setting:
Xcode: File Inspector: Interface Builder Document: Document Versioning: Development
to at least "Interface Builder 3.1".

Resources