SDWebImage / SDWebImageSwiftUI

SwiftUI Image loading and Animation framework powered by SDWebImage
https://sdwebimage.github.io/SDWebImageSwiftUI
MIT License
2.21k stars 230 forks source link

Missing required module 'SDWebImage' #79

Closed adamayoung closed 4 years ago

adamayoung commented 4 years ago

Not sure if this is an SDWebImageSwiftUI/SDWebImage issue, or a Swift Package Manager issue, but when I have an iOS app with an accompanying watchOS app, and include SDWebImageSwiftUI in both the iOS app and watchOS app extension (via SPM), building the watchOS app using the watchOS app scheme succeeds, but when trying to build the iOS app, the watchOS app build fails with an error in the SDWebImageSwiftUI library:

No such module 'SDWebImage'

If I remove the SDWebImageSwiftUI library from the watchOS app extension, I get an error in the watchOS app extension:

Missing required module 'SDWebImage'
dreampiggy commented 4 years ago

Sounds little strange.

Did you mean: When I create a dependent WatchKit App with SwiftUI (The Host WatchOS App is not gray), this cause the import issue ?

Can you have a quick test with other Package Manager like Carthage and CocoaPods, to test whether SwiftPM cause issues ?

dreampiggy commented 4 years ago

And, please do a clean build between you switch Xcode scheme, I doubt this is because some cache issues ?

adamayoung commented 4 years ago

Tried the clean build, and deleted the derived data directory, but no joy.

Here's the commit it's happening on

https://github.com/adamayoung/Movies/tree/641d17534a99aab103499103e818eba0fa3fa135

I've created an independent watch app now, and it's working as expected.

adamayoung commented 4 years ago

Instructions to reproduce:

dreampiggy commented 4 years ago

Can not reproduce on Xcode 13.1 ? Any extra steps ? I use the dependent WatchOS App as well.

dreampiggy commented 4 years ago

image

image

joeycarmello commented 4 years ago

I also hit this error, but only on the XCode 11.4 Beta.

dreampiggy commented 4 years ago

@joeycarmello @adamayoung Does Xcode 11.4 Beta 2 solve this issue ? https://developer.apple.com/documentation/xcode_release_notes/xcode_11_4_beta_2_release_notes?language=objc

joeycarmello commented 4 years ago

On Xcode 11.4 Beta 2 I get the following while attempting to resolve packages:

Source files for target SDWebImageMapKit should be located under DerivedData/[X]/SourcePackages/checkouts/SDWebImage
DerivedData/[X]/SourcePackages/checkouts/SDWebImage/Package.swift: target 'SDWebImageMapKit' referenced in product 'SDWebImageMapKit' is empty

I should add this is currently from the 1.0.0-beta2 release.

Edit: My issue seems to be this: https://github.com/SDWebImage/SDWebImage/issues/2941

dreampiggy commented 4 years ago

@joeycarmello @adamayoung

This issue seems been solved by Xcode 11.4-Beta3.

Check SDWebImage/SDWebImage#2941

anoop4real commented 3 years ago

I am getting this issue in XCode 12, tried both SPM as well as Cocoapods. I added a new WatchOS target to my existing iOS app and later on I get the error No such module 'SDWebImageSwiftUI' Both the projects fails to build ... any clue?

EricWVGG commented 3 years ago

Afraid I'm seeing this in XCode 13. Note that the project does compile and run correctly; the bug seems to be in Tests iOS, and interrupts SwiftUI previews.

image
chrishutchinson commented 2 years ago

Afraid I'm seeing this in XCode 13. Note that the project does compile and run correctly; the bug seems to be in Tests iOS, and interrupts SwiftUI previews.

I was also struggling with this breaking my SwiftUI previews. I was able to resolve it by ensuring the test target host application was set correctly:

  1. Navigate to your Xcode project in the left sidebar
  2. Select your "Tests" target
  3. In the General tab, under Testing, ensure you have a "Host application" selected

I hope that helps!

romrell4 commented 2 years ago

I am getting this issue in XCode 12, tried both SPM as well as Cocoapods. I added a new WatchOS target to my existing iOS app and later on I get the error No such module 'SDWebImageSwiftUI' Both the projects fails to build ... any clue?

@anoop4real Did you ever get this figured out? I'm getting this in Xcode 13 as well?

NamanVaishnav commented 2 years ago
Screenshot 2022-02-01 at 8 29 53 PM

^ if you are getting error in XCTests or XCUITest then select your test targate and perform this

ucwealth commented 1 year ago
Screenshot 2022-02-01 at 8 29 53 PM

^ if you are getting error in XCTests or XCUITest then select your test targate and perform this

Thanks. This worked for me

r10s commented 1 year ago

getting a similar error after a pod update with xcode 14.3.1 as well - from the diff, not much was changed, but afterwards i am getting the error No such module 'SDWebImage'