Kingfisher: Kingfisher stops the app from archiving on Xcode 13 RC
Issue Description
Kingfisher produces a large number of build errors when building for “Any iOS device (arm64)” with Xcode 13 RC.
What
It seems that it cannot find references to SwiftUI data types, even the import SwiftUI statement is present.
There is a workaround, but it’s not nice: we forked and bumped the minimum version for iOS in KF’s Package.swift to iOS 13, and the issue disappeared.
Reproduce
I made a sample project that reproduces the issue: KingfisherArchiveIssue.zip
Select “Any iOS Device (arm64)” and try to build (or archive).
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 15 (5 by maintainers)
Commits related to this issue
- Bump minimum OS to iOS 13 This is to get around #1802, which was introduced with the update to Xcode 13. https://github.com/onevcat/Kingfisher/issues/1802 — committed to neurotrack/Kingfisher by justin 3 years ago
- Bump platform version b/c of the issue: https://github.com/onevcat/Kingfisher/issues/1802 — committed to boom-me/Kingfisher by dadalar 3 years ago
Duplicated with #1725
As indicated in the Xcode 13 Release Notes:
Unfortunately Kingfisher falls into this (since it is supporting SwiftUI, which in turn using Combine to manage states).
This is not a thing can be fixed easily in a library like Kingfisher. So please try to upgrade to Kingfisher v7 (and consider to drop support under iOS 12. Here is the migration guide).
Here is an image (from Aug, 2021) that you can use to persuade your boss to drop those old ones:
I am not sure if this “Known Issues” can be fixed by Apple in near future. With the fact that the problem started to be there from Xcode 13 beta 2 to the final release, I doubt whether Apple has any motivation to fix it or mark it as urgent.
If you still need to support older systems (such as iOS 10 or 11), maybe it is a good idea to keep using Xcode 12 for a longer while before Apple fixes it.
TLDR
Determine the latest version you can use by:
version6-xcode13If you really have to support from iOS 10 in Xcode 13, and you are not using SwiftUI. Check the workaround here.
Detail for current workaround
For anyone who still needs to use Kingfisher v6 (for supporting iOS 11 UIKit or iOS 13 SwiftUI), but wants to use it in Xcode 13, now there is a compatible branch
version6-xcode13. Pointing your dependency of Kingfisher to that branch would help you to avoid this issue.The only change in that branch, compared to the released 6.3.1, is dropping of iOS 10 for UIKit support. That allows Xcode 13 skip the ARMv7 compilation so it won’t trigger this issue anymore. That branch would exist for at least one year so you can migrate to version 7 eventually.
Again, the deployment increment in Kingfisher v7 (iOS 12 for UIKit, iOS 14 for SwiftUI) is intended and important to provide a correct data model. If you do not need to support older system anymore, it is encouraged to upgrade to the latest version.
Some project need to modify configuration as follows:
Confused behaviour! 😂
We noticed this issue can be fixed by changing Project Format to Xcode 8.0-compatible within iOS 11. And then Architectures became
ARCHS_STANDARD_64_BIT, Archiving will not include armv7. But We recommend to set Xcode 12.0-compatible and modify pod targetconfig.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'to inherit project.Xcode 13.2 was released (as RC although) in which a fix for this is contained. Now even Kingfisher v6 could be used in Xcode 13.2.
Since my min supported iOS version is 13.0. This did the trick for me to fix cocoapods integration:
Hi, you can use Xcode 13+ and Kingfisher and iOS 11 (tested) if you will remove pods and install Kingfisher from SPM
Archiving work fine