Preview in Canvas not working due to 'duplication of library code'

In my project I use several third party Swift-packages and a single target. Everything builds and runs fine.
However SwiftUI-views don't show any previews.

When I press 'Resume' and 'Diagnostics' on the canvas it says:

Swift package target 'CNIOSHA1' is linked as a static library by 'HAP' and 2 other targets. This will result in duplication of library code.





This is a known issue related to Xcode previews building all package products dynamically. You may be able to work around it by making the affected products explicitly static, except for the one you are trying to preview, using the type argument.

For example, in this case you could make "HAP" an explicitly static product. Since the diagnostic mentions more targets being affected, this workaround might unfortunately be an iterative process.
But HAP an d the other packages are not my code they are all third party libraries
I understand that this makes the workaround more cumbersome, but unfortunately, there is nothing else I can recommend until this issue is fixed. You can follow the process outlined here to temporarily be able to edit your third-party dependencies for this workaround.
I have the same problem with swift-nio and swift-nio-ssl. For me this way doesn't work, I tried several combinations... I think a problem could be, that for example CNIOBoringSSL is not a Swift package, it doesn't have a Package.swift. Any advice how to solve this problems when using swift-nio and swift-nio-ssl?
Still broken in Xcode 12 Beta 2 :(
Same problem with RxCombine

Code Block
Swift package target 'RxSwift' is linked as a static library by 'RxCombine' and 'RxSwift'. This will result in duplication of library code.

Also experiencing this problem across multiple frameworks, this is completely breaking my development progress :(
No change for me on this in beta 4 of Xcode 12.
This is fixed in the release version of Xcode 12 for me. Previews are working fine in my project that has multiple dependent SPM packages.
Preview in Canvas not working due to 'duplication of library code'
 
 
Q