'Issue with Kingfisher in Xcode11 - Could not find module 'Kingfisher' for target 'armv7-apple-ios'; found: arm64, arm64-apple-ios

Using Kingfisher 5.7.1, I am unable to import Kingfisher for one class only - a UIImageView extension.

I can build for generic iOS device but if I try on a simulator or a device I get an import error.

I am able to import in another class but one still gives errors every time.

Building for device

Building for simulator

I have tried de-integrating Pods and re-installing. Deleting derived data, restarting Xcode, restarting computer. I still run into same issue.

import Foundation
import Kingfisher

extension UIImageView {

    public func setImageKF(usingURL url:URL) {
        self.kf.setImage(with: url)
    }

    func layoutImageShadow (shadowImg:UIImageView) {       
        snp.makeConstraints { (maker) in
            maker.top.right.equalToSuperview().offset(1)
            maker.width.height.equalToSuperview()
        }
    }
}


Solution 1:[1]

If you look at the Kingfisher podspec file, it has some minimum deployment targets:

  s.ios.deployment_target = "10.0"
  s.tvos.deployment_target = "10.0"
  s.osx.deployment_target = "10.12"
  s.watchos.deployment_target = "3.0"

It means that this pod won't run in armv7 devices (iPhone 3GS, 4, 4s, 5, 5c) that can't run iOS 10.0.

It will also not run in i386 simulators that emulate 32 bits armv7 devices.

If you try running on a arm64 build configuration, there is a more straightforward error message:

Compiling for iOS 9.0, but module 'Kingfisher' has a minimum deployment target of iOS 10.0:

Solution 2:[2]

I Suddenly got this error for my Import Statement, it wasn't There before in My Project. Error has gone after Clean & Build The Project

Solution 3:[3]

Got this problem in 2022 now, I am using Cocoapods/Xcode 13.2.1/Swift 5 . I finally get it solved by: 1 Select Pods.xcodeproj in Xcode. 2 Switch target to Kingfisher, 3 Change Deployment Info -> iOS 14.0

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 alxlives
Solution 2 Lahiru Pinto
Solution 3 user2825941