Swift package with resources in iOS project won't compile test targets

I am experiencing the same issue on Xcode Beta 3 with the Firebase SPM package only when archiving:

error: Unexpected duplicate tasks:
1) Command: ProcessXCFramework /Users/ferologics/Library/Developer/Xcode/DerivedData/Connect-dbcsglficrktpdavidwgrvvycdmw/SourcePackages/artifacts/Firebase/FirebaseAnalytics.xcframework ios
2) Command: ProcessXCFramework /Users/ferologics/Library/Developer/Xcode/DerivedData/Connect-dbcsglficrktpdavidwgrvvycdmw/SourcePackages/artifacts/Firebase/FirebaseAnalytics.xcframework ios
error: Unexpected duplicate tasks:
1) Command: ProcessXCFramework /Users/ferologics/Library/Developer/Xcode/DerivedData/Connect-dbcsglficrktpdavidwgrvvycdmw/SourcePackages/artifacts/GoogleAppMeasurement/GoogleAppMeasurement.xcframework ios
2) Command: ProcessXCFramework /Users/ferologics/Library/Developer/Xcode/DerivedData/Connect-dbcsglficrktpdavidwgrvvycdmw/SourcePackages/artifacts/GoogleAppMeasurement/GoogleAppMeasurement.xcframework ios

Edit: it is possible to work around as @ericyanush suggested above my post.

I am experiencing the same issue with Xcode 12.5 beta 3 as well. The problem is not in the test target, and not just when archiving. We can't even build the project.

Unexpected duplicate tasks:
1) Command: ProcessXCFramework /Users/victorbaro/Library/Developer/Xcode/DerivedData/Universe-hhtnbyfmvrffwmetinppdcipdpzy/SourcePackages/artifacts/Appboy_iOS_SDK/AppboyKitLibrary.xcframework ios simulator
2) Command: ProcessXCFramework /Users/victorbaro/Library/Developer/Xcode/DerivedData/Universe-hhtnbyfmvrffwmetinppdcipdpzy/SourcePackages/artifacts/Appboy_iOS_SDK/AppboyKitLibrary.xcframework ios simulator

Unexpected duplicate tasks:
1) Command: ProcessXCFramework /Users/victorbaro/Library/Developer/Xcode/DerivedData/Universe-hhtnbyfmvrffwmetinppdcipdpzy/SourcePackages/checkouts/AppsFlyerFramework/MacCatalyst/AppsFlyerLib.xcframework ios simulator
2) Command: ProcessXCFramework /Users/victorbaro/Library/Developer/Xcode/DerivedData/Universe-hhtnbyfmvrffwmetinppdcipdpzy/SourcePackages/checkouts/AppsFlyerFramework/MacCatalyst/AppsFlyerLib.xcframework ios simulator

In addition, those 2 frameworks are a dependency of an internal module, and are not a dependency of the main app.

MyApp
  |-> InternalPackage (dynamically linked)
    |-> AppsFlyerFramework
    |-> Appboy_iOS_SDK

Compiling was fine in iOS 12.4

This should be solved in the RC of 12.5

The Swift Bug [SR-13739] 'Unexpected duplicate tasks' error when using Swift Package with bundle resources linked from a Unit Test Target · Issue #4486 · apple/swift-package-manager · GitHub that captures this error, and it's attached bug reproducing project, still reproduces the bug in Xcode 12.5 RC (12E262).

I have also confirmed that it still reproduces with my own local SwiftPM project that is brought into my iOS app, regardless if the Swift Package explicitly states it's a dynamic library, or leaves it unspecified for SwiftPM / Xcode's build system to determine.

Sorry, I was replying directly to @victorBaro's post, didn't realize that there are actually two problems covered by this thread:

  • originally this was about duplication of resource bundles and this issue is still present in 12.5

  • some folks are mentioning the 12.5 beta 3 issue of duplicated tasks with binary frameworks which was a regression compared to previous versions. This has been fixed in the RC of 12.5

2 Likes

Ah, no worries. Thanks for the clarification.

Discourse's UI doesn't make direct replies intuitive when your reply is directly after the post you're replying to =/

Thanks @NeoNacho for the fast response. It is indeed working in 12.5 RC.

1 Like

It seems fixed in Xcode 13 beta 1
Here is my test project to test the issue: GitHub - simonpierreroy/BadApp