Xcode 10 意外重复任务:CopyPlistFile
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/52384152/
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
Xcode 10 unexpected duplicate task: CopyPlistFile
提问by Roman Podymov
Today I updated my Xcode from v.9.4.1 to v.10.0. Now I try to build my tvOS project and I see the following error: unexpected duplicate task: CopyPlistFile /Users/username/Library/Developer/Xcode/DerivedData/MyApplication/Build/Products/Debug-appletvos/MyApplication.app/Settings.plist /Users/username/project_folder/Settings.plist (in target 'MyApplicationTarget'). I tried to reinstall pods (I use CocoaPods 1.6.0 beta) and clean build folder, but it does not help. How can I solve this problem in Xcode 10?
今天我将我的 Xcode 从 v.9.4.1 更新到 v.10.0。现在我尝试构建我的 tvOS 项目,我看到以下错误:意外重复任务:CopyPlistFile /Users/username/Library/Developer/Xcode/DerivedData/MyApplication/Build/Products/Debug-appletvos/MyApplication.app/Settings.plist /Users/username/project_folder/Settings.plist(在目标“MyApplicationTarget”中)。我尝试重新安装 pods(我使用 CocoaPods 1.6.0 beta)并清理构建文件夹,但它没有帮助。如何在 Xcode 10 中解决此问题?
采纳答案by Roman Podymov
In my project.pbxproj file I had these lines:
在我的 project.pbxproj 文件中,我有以下几行:
FIRSTSTRING /* Settings.plist in Sources */ = {isa = PBXBuildFile; fileRef = FIRSTSTRING /* Settings.plist */; };
SECONDSTRING /* Settings.plist in Resources */ = {isa = PBXBuildFile; fileRef = SECONDSTRING /* Settings.plist */; };
As I can see Settings.plist was specified twice in this file, as source and resource.
正如我所看到的 Settings.plist 在这个文件中被指定了两次,作为源和资源。
I removed Settings.plist from my project and added it again in Build Phases -> Copy Bundle Resources. Now I see that the lines I mentioned above are missing and I have this line in my project.pbxproj file:
我从我的项目中删除了 Settings.plist 并在Build Phases -> Copy Bundle Resources 中再次添加了它。现在我看到我上面提到的行丢失了,我的 project.pbxproj 文件中有这一行:
THIRDSTRING /* Settings.plist in Resources */ = {isa = PBXBuildFile; fileRef = THIRDSTRING /* Settings.plist */; };
And now I am able to build my tvOS application with Xcode 10.0.
现在我可以使用 Xcode 10.0 构建我的 tvOS 应用程序。
回答by NickDK
I was getting this for a core data model .xcdatamodeld, It turned out the model file was listed under both "Compile Sources" & "Copy Bundle resources" in Build Phases. Removed it from the latter and it build in Xcode 10 finally!
我为核心数据模型 .xcdatamodeld 得到了这个,结果模型文件在构建阶段的“编译源”和“复制捆绑资源”下都列出了。从后者中删除它,它最终在 Xcode 10 中构建!
回答by sahiljain
Faced same problem. Resolved it using following
面临同样的问题。使用以下方法解决它
go to Target -> Build Phases
Check if your file is appearing in both Compile sourcesand Copy Bundle Resourcessection, if yes remove it from Compile Sources
检查您的文件是否同时出现在Compile source和Copy Bundle Resources部分,如果是,则将其从Compile Sources 中删除
回答by Asif
File -> Workspace Settings -> Change New Build System to Legacy. It worked for me .
文件 -> 工作区设置 -> 将新构建系统更改为旧版。它对我有用。
回答by ElectroBuddha
In my case, the conflicting files were not listed in Copy Bundle Resourcesbut only in Compile Sourcessection.
就我而言,冲突文件未在Copy Bundle Resources 中列出,而仅在Compile Sources部分中列出。
I went in project navigator, selected the file, and in File Inspector / Target Membershipunselected and again selected the app target (untick and tick checkbox next to app target).
我进入项目导航器,选择文件,并在文件检查器/目标成员资格中取消选择并再次选择应用程序目标(取消勾选并勾选应用程序目标旁边的复选框)。
The files disappeared from 'Compile Sources' and appeared under 'Copy Bundle Resources' and I was able to continue with the build process.
这些文件从“编译源”中消失并出现在“复制捆绑资源”下,我能够继续构建过程。
回答by Smartcat
Go look at that target's build phase that copies resource files and see if your Settings.plist is listed more than once.
去看看那个复制资源文件的目标的构建阶段,看看你的 Settings.plist 是否被多次列出。