Many files "missing from working copy" in Release-iphonesimulator - ios

I'm having trouble with a whole bunch of warnings about missing files since upgrading to Swift 3 in Xcode 8.1. I've attached an image with a sample of the errors. There are about 40 of them in total.
All refer to files missing from MyApp/build/MyApp.build/Release-iphonesimulator/MyApp.build/Objects-normal/x86-64/.... None of them are files which I would not have touched or edited.
I have cleaned and rebuilt, cleaned build folder, deleted all derived data, and a few other things, all with no luck. The app compiles and runs, but has this stack of warnings I can't get rid of.
I also double checked my Release Search Path in Build Settings. Here is what I have it set to:
These have me stumped. Any suggestions appreciated.

I finally solved this. It WAS version control related. I had tried committing and resetting status, with no luck. However, when I tried a Pull, it said I had uncommitted changes, even though I had just committed. Therefore, I tried Discard All Changes, and that solved it. Did a clean and build and the warnings are now gone.

Related

Xcode Pinterest.h file not found

So I have looked high and low for a fix for this and nothing seems to work. I have a a project that works 100%, but when I transfer it over to another mac I get the following error. Pinterest.h file not found. However this file is in fact present and makes no sense why I am getting this error. I have tried cleaning build, cleaning build folder, restarting xcode, checking build paths and I simply cannot figure out this issue. Here is an image of the error
and here is an image of the class that is causing the error
Literally any help on this would be amazing, I am using sharekit if that helps at all.
Are you sure you have Pinterest.h included in the actual project? It could be that, on your second device, you forgot to include the Pinterest.h as a file inside the project itself. It might be within the directory structure, but that doesn't mean that it's included in the Xcode project.
With the limited images you provided, it's really hard to tell one way or the other. Can you provide more information/images?

Xcode compilation (fatal) error

I upgraded my system to OS X Yosemite and now I'm getting this error when I try and build my iOS projects:
fatal error: file '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.0.sdk/usr/include/sysexits.h' has been modified since the precompiled header '/Users/sidatre/Library/Developer/Xcode/DerivedData/Project_Chow-dlqpzktxazigviayrdmdiwvrvitj/Build/Intermediates/PrecompiledHeaders/Project Chow-Prefix-eswczkpscchtlodgkuyyxqdzoayy/Project Chow-Prefix.pch.pch' was built
Any insights?
Do a clean build. This will remove the precompiled header.
2 things,
Go to product->clean in the top bar, this will.. Well... Clean it up, sometimes it won't work in your case so
Compile it again, if it's been modified after compiling it.
If this still does not work, then try saving it, then compile it, if it still does not work (which is a bit unlikely) then try going to that exact fault file, just a warning this is a bit risky, so make a backup btw, see what's in it; if you think it's important, see if there is any way of editing it indirectly on Xcode (by writing code), if not then try deleting it then make it again with the same text, just do it yourself. I wouldn't recommend deleting it, but if it is still not working that may be your only option.
I hope this helps.

xcode duplicates files in project

I'm at a complete loss as to what I did to cause this:
For the second time since I started using XCode about a month ago (my first time seriously using it after taking one class several years ago) I try to run my project and the next thing I know I have errors because I have duplicate references. I looked at the project and it appeared that most of the files in my project had duplicated themselves, however I discovered that they are not duplicate files just duplicate references. This happened to me today when I tried to build on an actual iphone for the first time but it also happened to me a few weeks ago while using the simulator. Neither time do I recall doing anything unusual. I have built and tested the project probably 100+ times and normally all goes ok. I was able to fix it the first time but I think I have made it worse this time and am probably going to add the files back into a new project. My co-worker also mentioned this happening to him (he has about as much experience with xcode as I do). He told me he ended up with files nested in folders (groups?) nested in other folders about 20 deep.
My question is this: Does anyone know what I may have done to cause this. I would really like to avoid this problem in the future since it is proving to be quite a headache. Any advice would be greatly appreciated.
E.T.A. xcode version 4.6.2 (possibly an earlier version the first time it happened)
Try this instead:
Highlight all the duplicate files
Right click on one of the files and press "Delete"
When prompted for which delete option, click "Remove Reference"
Also you asked for "any advice".
If you aren't already using git source control in your Xcode projects, start now.
You can spot many mistakes like this earlier and fix them more easily using git.
When you add files as a copy, the Xcode project navigator shows added files with an A and modified files with an M.
If the file is inside a closed group folder, the folder shows an A.
If you add a reference without a copy the project navigator won't show an A but MyApp.xcodeproj will show M.
In Xcode you can discard a change before committing it.
In the case below, you would discard changes to all added or modified files.
Typically you review and commit changes frequently.
Using a gui tool such as SourceTree, you have a good chance of spotting an accidental change before you commit. For example, you can see changes to the project file.
If you accidentally commit an unintended change, you can go back later and reverse a commit.
By committing frequently, you have more control over which changes you undo and which ones you keep.
References:
http://www.raywenderlich.com/13771/how-to-use-git-source-control-with-xcode-in-ios-6
http://git-scm.com/doc (scroll down to see videos)
http://www.sourcetreeapp.com
http://gitimmersion.com
I had the same 20 deep nesting of my main folder of images. If its not a bug its very strange behaviour. I just backed it all up !! Then I opened the folder in finder, found the point at which it was starting to nest and deleted it.
I did a rebuild, but I don't think Xcode even noticed. It made no difference to the size of my app so Xcode was not putting unnecessary files in the binary.
This happened to me when I imported a file. Suddenly I had two nested directories containing what looked like copies of all my files. The compiler complained about duplicate classes.
I found a solution, but it's a ball-ache and a time sink.
1: Click on your project in the navigator to open up the project settings in the main view.
2: Open the 'Compile Sources' accordion entry.
(This allows you to see which files are being used in the compilation process.)
3: Find any duplicates in here and delete them.
(At this stage your project should compile again.)
4: In your navigator view, slow-double-click one of the files that's duplicated there. This should allow you to rename it. Change the name (not the extension) slightly.
5: You should notice that the copy becomes red. Select it and hit delete.
(This avoids the delete operation removing the file from the 'Compile Sources')
6: Rename the original file back to its original name again.
7: Repeat from 4 until done, or until bored.
8: Explain to your boss why a simple copy change took half a day.
This process can be optimised up by first renaming all duplicated files, then deleting the duplicates all at once. However this means that you can't test for successful compilation between steps, which allows you to narrow the culprit down to a single file. And takes even more time.
If compilation fails, ensure all the files you need are still in the 'Compile Sources' section, as this process can cause them to be lost from there. The compiler will normally give some reasonable errors about missing classes and variables, but a missing AppDelegate will produce a more confusing error.

Xcode Won't Parse Files to Find Errors

I have a strange issue that I haven't seen or read about anywhere else. My Xcode no longer parses all of my files to find issues/errors. It will display any issues or errors in a file I am currently viewing, and these will persist thereafter, but with 400+ files I can't reasonably visit each one to make it compile. Xcode can build successfully if the code is valid, however I can never know when that is, since I see no errors. Indexing occurs, but no compiling takes place.
Also, when building, the status bar states that Xcode is compiling x out of however many total compile sources but the total number is usually not even close to the actual total number. For example it may say compiling x out of 40 files when there are actually 400 compile sources.
I wasn't doing anything out of the ordinary from my usual tasks when this issue began. New projects will compile, then randomly stop compiling after a period of time.
Things I have tried:
nuking derived data
quitting Xcode/restarting computer
Recloning the project from a known working repository. It will build but won't find errors/issues when they do exist. There should be at least a handful of minor issues but none appear.
Reinstalling Xcode (4.5.2)
tried both GCC 4.2 and LLVM 4.1 compilers
Has anyone experienced this issue before and found a solution? This problem has made my job extremely difficult and any help would be much appreciated.
It does sound like corruption of DerivedData. Try this:
Clean your target: cmd+shift+K or Product->Clean
Quit xcode
Delete the contents of /Users/your_user/Library/Developer/Xcode/DerivedData
Restart xcode
(It's safe to delete this folder's contents. But if you're nervous about that, back it up first).
You should be good to go.

.PNG not copying to device bundle

I've been stuck with a huge problem for a few days now and it is very frustrating. Everything was working perfectly until I messed around with target settings/provisioning a few days ago. Essentially no images are being copied from the project to be included in the app bundle.
I have:
Double checked their case consistency
Made sure they are all included in copy resource bundle section of
build phases
Performed multiple cleans and manual clean outs of the derived
data folder
And the images appear fine in the simulator.
I really don't know where else to turn or what else to try. Any help in solving this would be HUGELY appreciate as I am trying to release an update for an app but am unable to do so before getting this fixed.
ALso it is worth mentioning ever since this problem started occuring it happens in all of my xcode projects.
Check the build log. It's in the "Log Navigator" tab (press command-7). The build log graphically shows the results of the build steps.
Check the path of the individual "CopyPNGFile" steps. You can also open the textual log by clicking the far right button in each build step.

Resources