Marsolgen
Marsolgen

Reputation: 187

Xcode error when attempting to archive project: Unexpected duplicate tasks

My project runs totally fine with no warnings on both the simulator and a real device, but when I try to archive it, I get this error:

Unexpected duplicate tasks:

1) Target 'SwiftDataTables' (project 'Pods') has copy command from '/myAppPath/Pods/SwiftDataTables/SwiftDataTables/SwiftDataTables.bundle/column-sort-descending.png' to '/Users/Marius/Library/Developer/Xcode/DerivedData/myAppName-bvaclcqghnevllgdezgzmpfvrzrz/Build/Intermediates.noindex/ArchiveIntermediates/myAppName/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/SwiftDataTables.framework/column-sort-descending.png'

2) Target 'SwiftDataTables' (project 'Pods') has copy command from '/myAppPath/Pods/SwiftDataTables/SwiftDataTables/SwiftDataTables.bundle/column-sort-descending.png' to '/Users/Marius/Library/Developer/Xcode/DerivedData/myAppName-bvaclcqghnevllgdezgzmpfvrzrz/Build/Intermediates.noindex/ArchiveIntermediates/myAppName/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/SwiftDataTables.framework/column-sort-descending.png'

I get this error 3 times, one for each of the pictures that are in the SwiftDataTables.

I have already tried cleaning the project, uninstalling and reinstalling the problematic library, and removing all the files from Derived Data. From what I have seen from other similar questions, the solution is often checking that a file isn't listed both in Copy Bundle Resources and Compile Sources in target/Build phases, but I can't find any file that is listed twice.

Thanks in advance.

Upvotes: 1

Views: 3631

Answers (2)

devno
devno

Reputation: 93

I could fix it by selecting the three images in Xcode and then remove the Target Membership for SwiftDataTables and adding it again.

Untick and tick target membership in Xcode

Upvotes: 5

Tommie C.
Tommie C.

Reputation: 13181

Try again - In the file navigator you can try searching (Cmd+F) to see if the files are somehow in the project twice. Try removing entire framework and any references from the file navigator and the build settings (check under Frameworks folder, et al), and then re-add. Check the pods files listed in the build settings. There is a place where the file paths are added for example if you tried using Carthage previously where the duplication is occurring.

Upvotes: 0

Related Questions