Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 10 unexpected duplicate task: CopyPlistFile

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?

like image 301
Roman Podymov Avatar asked Sep 18 '18 10:09

Roman Podymov


5 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!

like image 57
NickDK Avatar answered Oct 18 '22 23:10

NickDK


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

like image 23
sahiljain Avatar answered Oct 18 '22 22:10

sahiljain


File -> Workspace Settings -> Change New Build System to Legacy. It worked for me .

like image 13
Asif Avatar answered Oct 18 '22 23:10

Asif


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.

like image 8
ElectroBuddha Avatar answered Oct 18 '22 23:10

ElectroBuddha


Go look at that target’s build phase that copies resource files and see if your Settings.plist is listed more than once.

like image 2
Smartcat Avatar answered Oct 18 '22 23:10

Smartcat