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?
7 Answers
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!
-
You're a lifesaver! – Shah Jul 18 '21 at 20:58
Faced same problem. Resolved it using following
go to Target -> Build Phases
Check if your file is appearing in both Compile sources and Copy Bundle Resources section, if yes remove it from Compile Sources

- 2,215
- 1
- 29
- 39
File -> Workspace Settings -> Change New Build System to Legacy. It worked for me .

- 227
- 3
- 5
-
In newer versions of Xcode this is changing: **File > Project Settings > New Build System** to **File > Project Settings > Legacy** – JoeVictor Mar 22 '20 at 22:34
In my case, the conflicting files were not listed in Copy Bundle Resources but only in Compile Sources section.
I went in project navigator, selected the file, and in File Inspector / Target Membership unselected 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.

- 630
- 10
- 20
-
1I use my own pod in my apps and did this untick -> tick for a while when i was building versions of my app. I now found the problem my file was not in the Resources folder putting it there solved the problem permanently. Maybe this helps someone. – ANE Jun 16 '20 at 13:54
Go look at that target’s build phase that copies resource files and see if your Settings.plist is listed more than once.

- 2,834
- 1
- 13
- 25
-
This file is listed only once in MyApplicationTarget/Copy Bundle Resources. – Roman Podymov Sep 18 '18 at 10:18
-
I assume you also tried quitting Xcode, deleting DerivedData folder, and then relaunching Xcode? – Smartcat Sep 18 '18 at 10:21
-
1I deleted the DerivedData folder, relaunched Xcode 10, cleaned build folder, but error is still the same. – Roman Podymov Sep 18 '18 at 10:27
In my project.pbxproj file I had these lines:
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.
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:
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.

- 4,168
- 4
- 30
- 57
if using firebase then delete GoogleService-Info and add agin in project It worked for me .

- 256
- 2
- 8