Kingfisher: Installing KingfisherSwiftUI via CocoaPods is not working

Created on 16 Nov 2019  ·  8Comments  ·  Source: onevcat/Kingfisher

Check List

Issue Description

Installing KingfisherSwiftUI via CocoaPods not working

What

After running pod install, Xcode shows error " No such module 'KingfisherSwiftUI' ".

Reproduce

  1. add pod 'Kingfisher/SwiftUI' to your podfile.
  2. run pod install
  3. import KingfisherSwiftUI in your swiftUI view.
  4. error will be shown

Most helpful comment

CocoaPods only provides a single module so you can try import struct Kingfisher.KFImage to use the KFImage type for SwiftUI.

All 8 comments

CocoaPods only provides a single module so you can try import struct Kingfisher.KFImage to use the KFImage type for SwiftUI.

CocoaPods only provides a single module so you can try import struct Kingfisher.KFImage to use the KFImage type for SwiftUI.

Yes this works. Thanks. Maybe you may add this in the documentation.

Yes, you are right!

Thanks @onevcat, it works!
why don't you add it to documentation?

Finally got some time for the documentation. https://github.com/onevcat/Kingfisher/wiki/SwiftUI-Support#basic

Thanks!

I did this in my code:

import struct Kingfisher.KFImage
KFImage(URL(string: img)).resizable()

it crashed:

dyld: Symbol not found: _$s10Kingfisher7KFImageV7SwiftUI4ViewAAMc
Referenced from: /private/var/containers/Bundle/Application/11AA53B4-C799-4D5D-B5F3-651DFAB0A0B8/GeekMadeBySwiftUI.app/GeekMadeBySwiftUI
Expected in: /private/var/containers/Bundle/Application/11AA53B4-C799-4D5D-B5F3-651DFAB0A0B8/GeekMadeBySwiftUI.app/Frameworks/Kingfisher.framework/Kingfisher
in /private/var/containers/Bundle/Application/11AA53B4-C799-4D5D-B5F3-651DFAB0A0B8/GeekMadeBySwiftUI.app/GeekMadeBySwiftUI

@Insfgg99x How did you install the Kingfisher and related components?

Not sure why, but this error seems to be happening when you are not copying the framework to your final app bundle. So I suggest checking the way and config you are using to add the Kingisher (and its SwiftUI support) to your project.

For those interested, cleaning and rebuilding my project fixed the dyld: Symbol not found error.

Was this page helpful?
0 / 5 - 0 ratings