为什么我的 xcode 项目文件中有恢复的引用?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/46200841/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Why are there recovered references in my xcode project file?
提问by MonkeyBonkey
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.
我有一个 react native 应用程序,只是注意到Recovered References
在我project.pbxproj
的 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?
我不记得添加或删除任何引用,恢复的引用显示了我通常使用的库。在不知道这些更改是什么的情况下,我犹豫是否要检查 git 的本地更改。我应该放弃这些更改吗?
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?
如果我自己没有添加或删除这些包,有人可以解释为什么可能会添加这些行吗?这是否意味着删除了一些参考资料以便以后恢复?我唯一能想到的是我运行了 react-native 链接,这会做出这些改变吗?
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>";
};
采纳答案by RobertK
From: Release Notes for Xcode 9 Beta 2:
来自: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)
打开项目时,Xcode 将检测项目中目标中的任何构建文件是否表示该项目的组树中不存在的文件引用。任何此类引用都将添加到名为“Recovered References”的文件组中,如有必要,将创建该文件组。应根据需要在项目中手动重新组织这些引用。(22924751)
回答by brkeyal
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.
在我的项目中,我发现项目中添加了一个“Recovered Reference”文件夹。它包含对我最近手动删除的文件的引用,它只存在于项目中(不在磁盘上)。可能是因为在从编译源中删除这些文件之前手动从磁盘中删除了这些文件。即使我后来修复了它,那些文件也卡在那里。
Solution was to delete the whole folder (Right click on it -> Delete)
解决方案是删除整个文件夹(右键单击它-> 删除)
回答by The1Grenade
In addition to what RobertK provided, in my project I noticed that these Recovered Referenceswere also appearing in the target's project Build Phasesas duplicates, seemingly located at strange file addresses.
除了 RobertK 提供的内容之外,在我的项目中,我注意到这些恢复的引用也作为重复出现在目标的项目构建阶段中,似乎位于奇怪的文件地址。
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 redrecovered file references from the Project Navigator, and then quit & reload your project, finishing with a clean & rebuild for good measure.
我发现我可以安全地删除(使用-
按钮)您在构建阶段...in
奇数位置下找到的任何恢复参考。从项目导航器中删除红色恢复的文件引用,然后退出并重新加载您的项目,以干净和重建完成以进行良好的测量。
I wish I could shed some light on howor what causesthese 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.
我希望我能阐明如何或是什么导致这些奇怪的文件被创建,但是在一个项目中有多个开发人员时,可能很难捕捉到初始事件以跟踪它。
回答by NilsVikt
As gheni4 mentioned, Xcode 9 adds several *.a files under a Recovered References for some reason. By removing the folder and all targets except the iOS one (iOS-Test, tvOS, tvOS-Test) they are no longer automatically created and I can finally build without errors.
正如 gheni4 提到的,Xcode 9 出于某种原因在 Recovered References 下添加了几个 *.a 文件。通过删除文件夹和除 iOS 之外的所有目标(iOS-Test、tvOS、tvOS-Test),它们不再自动创建,我最终可以无误地构建。
回答by Joe Susnick
Fixed it by renaming the file, manually removing everything in the project file related to Recovered References
quitting Xcode, and running synx - a useful ruby utility. When I opened it again I could build and everything was fine.
通过重命名文件、手动删除项目文件中与Recovered References
退出 Xcode相关的所有内容以及运行 synx(一个有用的 ruby 实用程序)来修复它。当我再次打开它时,我可以构建,一切都很好。