Why are there recovered references in my xcode project file?
I have a react native app and just noticed that a few lines were added for Recovered References
in my project.pbxproj
file in Xcode.
I don't remember adding or deleting any references and the recovered references show libraries that I normally use. I'm hesitant to check in the local changes to git without knowing what these changes were. Should I just discard these changes?
Can someone explain why these lines might be added if I didn't add or remove these packages myself? Does this mean some references were deleted to later be recovered? The only thing I can think of is that I ran react-native link, would that have made these changes?
This line was added
E3C5B1001F6966D2006296E1 /* Recovered References */,
This entire section is new:
E3C5B1001F6966D2006296E1 /* Recovered References */ = {
isa = PBXGroup;
children = (
E602D61E379048BF92DC0C6D /* libRNDeviceInfo.a */,
DEE39860F1B042208F193884 /* libRNVectorIcons.a */,
C193FEFE9F3B45388016E921 /* libRNShare.a */,
58B3A26CAB2543FB941C3D8D /* libRNFIRMessaging.a */,
0BFBA42D662C492EBC1957A0 /* libreact-native-branch.a */,
4BC248DD95524DE091A41CEC /* libCodePush.a */,
6DB0E4FE64B34B68A29B262E /* libRNImagePicker.a */,
E1502CC537D94CF4A5711814 /* libRNAddCalendarEvent.a */,
065361D30B3F47D4A5101A1D /* libRNAccountKit.a */,
);
name = "Recovered References";
sourceTree = "<group>";
};
From: Release Notes for Xcode 9 Beta 2:
When a project is opened, Xcode will detect if any build files in targets in the project represent file references which are not present in that project’s group tree. Any such references will be added to a file group named “Recovered References” , which will be created if necessary. These references should be manually reorganized in the project as appropriate. (22924751)
In my project I found out there's a "Recovered Reference" folder added to the project. It held references to files I recently deleted manually, and it existed only in the project (not on disk). Probably It happened as a result of deleting those files manually from disk before removing them from the Compile Sources. Even though I fixed it later, those files were stuck there.
Solution was to delete the whole folder (Right click on it -> Delete)
In addition to what RobertK provided, in my project I noticed that these Recovered References were also appearing in the target's project Build Phases as duplicates, seemingly located at strange file addresses.
className.swift ...in some/odd/nonProject/folder/structure
Basically anything other than what most other files show, like:
...in ProjectName/KnownFolder/ExpectedLocation
I found that I could safely remove (using the -
button) any Recovered Reference that you find under Build Phases ...in
odd locations. Delete the red recovered file references from the Project Navigator, and then quit & reload your project, finishing with a clean & rebuild for good measure.
I wish I could shed some light on how or what causes these odd files to be created, but here with multiple developers on a project it can be difficult to catch the inception event in order to track it down.