New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when using Kingfisher with SPM and Xcode 11.4 beta 3 #1418
Comments
Ref https://forums.developer.apple.com/thread/128806 Now I am not sure whether it is the intended behavior of Xcode or not. But indeed there could be a problem if linked statically multiple times. I hope Xcode could be intelligent enough to solve this kind of linking problem for developers, since all the targets are linking to the same library, so it should be not hard for the building system to strip duplicated copies from the final binary. However, it is not happening now. A possible solution would turn Kingfisher to a dynamic library, which is not the default choice in Swift Package Manager. This requires an update in our |
Still not fixed in final Xcode 11.4 (11E146) release from today :/ |
Yep, this really sucks |
@kabouzeid @OscarGorog There is a patch branch Please make sure that using Kingfisher as a dynamic framework would be what you want (since previously it was static linking). |
Working perfectly, amazing quick patch! |
Yes it works. I used the same fix for some other libraries too. I don’t understand why this is necessary though, in the SPM docs it says that it is recommended to leave this property unspecified so SPM can figure it out automatically. And since it worked before, this must be a bug in Xcode, right? |
I would think so but not too sure... is it worth filing a radar or just waiting for the next Xcode release and seeing if it gets fixed? |
I think it’s worth filing a radar. There must be many devs with this problem right now. |
Alrighty, I’ll do it in the morning (Melbourne) and post it here |
@marcosatanaka Since it is now a dynamic library, you need to also add it to the Embedded Framework section to make sure it is copied to the final bundle. |
@simoa According to the post here: https://forums.developer.apple.com/thread/128806#411572
Maybe it worths trying an Xcode restarting? |
@simoa But basically, you should not embed Kingfisher in an extension target. Try to only link them there, and only embed Kingfisher in your main app target. |
After removing the embed as a framework everything is working. Thanks so much
On 26 Mar 2020, at 14:30, Wei Wang <notifications@github.com> wrote:
@simoa<https://github.com/simoa> But basically, you should not embed Kingfisher in an extension target. Try to only link them there, and only embed Kingfisher in your main app target.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#1418 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAJ5BLPZQ6AUZFBKWKHGFXTRJNRHRANCNFSM4LQ5V3TQ>.
|
Version 5.13.3 was released, containing changes in this PR #1420. I will leave the branch for a while and delete it eventually to keep the repo clean, so please switch to the version-based dependency soon. |
I know the issue is closed already. But seems it seems to be a problem with project configuration and not with Xcode or the library. I had to fix the version on my project to 5.13.2 if I don't want to start embedding Kingfisher in every framework I need to use. |
I reverted the default dynamic change since there is no way to workaround the extension targets. I added some suggestions on this topic at #1426 and will provide all build configurations from the next release. |
This is fixed in Xcode 11.4.1 as below:
Now Kingfisher provides all build configurations as |
Check List
Issue Description
What
I'm using Kingfisher in both my containing app, and two other targets. I've added it using Swift Package Manager on Xcode. On Xcode 11.3 everything works fine, but when updating to Xcode 11.4 beta 3, I started to get the following error:
Swift package product 'Kingfisher' is linked as a static library by {APP NAME} and 2 other targets. This will result in duplication of library code.
Reproduce
Other Comment
Is this something to do with the way my project is organized, or is something that needs to be fixed on the Kingfisher project? Or is bug in Xcode?
Thanks!
The text was updated successfully, but these errors were encountered: