I'm seeing a problem with the latest released version of XCode 7, where if I create a brand new Swift project, and build it, the full index is not being created. This means things like Superclasses, Callers, and Callees in the Assistant Editor are not being populated. If I create a brand new Objective-C project, all of this information is generated correctly. If I download older projects from Github, for example, even if they are in Swift, the information is generated. It just seems like projects that are more recently created (say, in the last 6-8 months), are not indexing properly. This includes projects downloaded from Github, for example, and not just projects I have created. I have re-installed Xcode, which didn't help. I did try out the newest Beta version, and that seems to work, but I can't submit apps using that version, so would like to figure out what is going wrong with the released version of XCode.
I haven't seen any reports of anyone having a similar problem. I deleted all XCode plugins, but that also didn't help. It seems like normally the indexing process happens after the build process finishes. In the cases where I don't get an index generated, I don't see the "Indexing.." message show up in the XCode toolbar.
Any thoughts? Thanks!
Related
I have a Xcode project I got from another developer. Initially when I opened it it has a bunch of errors (most of which were un-updated frameworks). I got it to work after a while and I fixed it. I want pass it back to the manager since I'm leaving uni in a few months. I copied it over to my friends Mac to see what would happen if I just took the project and all it's folders and made it a zipfile. It didn't work for some reason. It gave me an error:
error: using bridging headers with framework targets is unsupported
But why did that come up? I mean it's the same code on the slightly different versions of Xcode (13.1 versos 14.1) but I doubt there was a massive change between the two that would cause this. I want to be able to pass these app later in the future without having to care about this stuff. I made a GitHub (link below) would cloning that work? Also the laptop I chose was just a fresh reset. Would it be due to not having coco-pods installed?
I feel like I could go through and fix it all on that laptop and document that but then I'm afraid that every time I put it on a new one it would come up with random errors every single time making my documentation moot.
https://github.com/AbdullahMSaid/SonicExperiment-Works
With big help this was Fixed.
Things that fixed it.
Having the correct version of Xcode
Turning everything from absolute path to relative
Lots of other code fixes. But those are my project specific.
You don't need bridging headers in framework. Use should have something like "YourFramework.h" where you can import your .h files.
I recently acquired a newer MacBook to run the most recent iOS and Xcode versions. I copied a project folder to the new Mac and opened it with Xcode 11.4 (was 10.1 on old Mac). I get 14 errors all related to "Failed to render and update auto layout status for ..VeiwController". The simulator runs fine, but the main storyboard doesn't render the button icons properly. I can add new constraints to the buttons to show them properly but the errors don't go away. I assume I have lost some info/files related to autolayout when I copied folders. I have read about similar issues. Most talk about using Github or some other 3rd party for maintaining files. Is there any other way to get this done? It seems like updates computers/software should be simpler.
Since reporting this, I have used the same process of copying folders of all other projects and have had no problems. But one project, the largest and most complex continues to have 14 rendering errors and always the displayed err message "An internal error occurred. Editing functionality may be limited." The strange thing is going in and out of viewing Main.storyboard several times gets rid of the errors eventually. Unfortunately, the errors always come back when I open the project. And sometimes they go away, then come back randomly in the same session.
So the answer to "whats the simplest way to copy a project folder to new computer is just that - Copy the project folder! But thats the wrong question for this problem.
I am posting this after reading many similar posts on here regarding this issue and none of the solutions that worked for other people not working...
Xcode Version 8.3.3 (8E3004b)
Swift 3.1
Things I tried
Deleting Derived Data folder
Deleting Workspace File
Cleaning Build Folder
Cleaning Build
Reinstalled Xcode (after complete removal)
I also looked for Swift Issues:
Removed all concatenating strings
Cleaned up Swift arrays and dictionaries
Added Whole module optimizations
This all started happening after last Xcode update of 8.3.3. My project was compiling within seconds and now I have to wait at least 15 mins for it to index, then 5 minutes to compile after everything I change even something small in code.
When Building, it get stuck in "Compiling Swift source files". Is there way for me to look in to where it is actually getting stuck?
BIG UPDATE
I tried pretty much everything. Read every article, post, ect. NOTHING worked. My project was created right after 10.0.
Solution
Creating a new project and copying each file worked! It used to take 8-9 minuted to build. Now less than 2 seconds!
Apple knows about this problem, and says that Xcode 9 beta will perform much better. Note that if you don't want to update to Swift 4, you can continue compiling in Swift 3 mode using Xcode 9. The big limitation is that you won't be able to submit your project to the App Store until Xcode 9 goes final.
Also, Xcode 9 contains a new build system. You don't get it by default: you have to turn it on for this project. Choose File > Project Settings and switch the pop-up menu to New Build System (Preview). This is experimental, but it will be the default build system eventually, so it would be interesting to know whether this makes an appreciable difference.
If you don't want to update to Xcode 9 beta, you will just have to do a binary search: comment out all your code and start adding it back, piece by piece, until you find that piece that's causing the trouble.
The best way to work this out is to find what out what the build is doing while compiling your code. This is a really useful tool to use: https://github.com/RobertGummesson/BuildTimeAnalyzer-for-Xcode
When you run this tool it will show you what methods are taking the longest to compile, and then you fix those. Once you have done that, you can also try the answer I gave here to decrease the build times: Extremely long compilation times with Swift in Xcode
I just start to learn Swift and have little background in programming.
I am trying to use Swift to make a to-do list. Before starting a new project in Swift, I deleted the previous to-do project, which I use objective-c to write.
I used the same name as the project name and the path is the same (on the Desktop).
After I put several new views on the storyboard, I run it. It turns out to be the old project, even though I have deleted the old files completely[empty the trash can].
You see I add no entry in the table view.
but after run it, I get
These static entries are from my previous project.
I just wonder how I can get rid of my previous project.
Any helps will be appreciated!
I think you answered the question yourself. Clearly the problem is that you have remnants of your old program, so start a new project with a different name. You probably deleted references to your old files, but did not delete the files themselves. Xcode is great about dragging & dropping in files from other projects, or just copy & paste the relevant code from this project into a new one. Also, the Xcode Beta is a little buggy, so a restarting Xcode, or even a good old-fashion re-boot can never hurt. I've gotten Xcode into a couple funky states that required killing it and re-starting.
UPDATE: QUESTION CLOSED: Fixed myself with a little backtracking. I'm using a framework that requires a source tree variable. (Sparrow). I updated the source tree on my main Mac Mini but not in my MacBook Pro. So, Xcode was searching an old directory due to that mistake.
This may be one of those weird Xcode bugs, so I'm looking for a little advice. I have Xcode 4.3.2 (latest as of this writing Apr 7 2012) installed on two Macs. I have a project saved in Dropbox so I can quickly get at it and work on it from either place. I've done this with several other projects and never experienced this issue.
One one computer, a Mac Mini, the project builds fine. On the other, a 2009 MacBook Pro, I get build errors. For one, even though I'm using -fno-objc-arc on a few of the source files, I am still getting ARC related errors. That is very puzzling to me. No issue when building on the Mac Mini. I'm also getting "file not found" errors pertaining to the .pch file. The error log is pointing me to a strange path like
/var/folders/9l/s_phv6yj0hv6q82_lrdcckb00000gn/C/com.apple.Xcode.501/SharedPrecompiledHeaders/...Prefix.pch' file not found
Here's what I've tried so far
Deleted Xcode and reinstalled from the MAS
Deleted the /var/folders directory called out in the logs
Removed the project build directory
Performed a Product -> Clean in Xcode
Restarted Xcode numerous times
Still no dice. Looks like unless I can nail down this issue, I'll be stuck working from one workstation for this project only. All other projects work fine when doing this.
Thank you for any help you can offer.
I was using a Source Tree variable in XCode, and one of the variables was out of date and pointing to the wrong path. One of the source files that was subsequently updated was working on one Mac but throwing errors on the other, which caused the build to fail and the linker to display strange errors.