SDWebImage / SDWebImageSwiftUI

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

Could not find module 'SDWebImageSwiftUI' for target 'x86_64-apple-ios-simulator'; found: arm64, arm64-apple-ios-simulator #149

Closed color123 closed 3 years ago

color123 commented 3 years ago

Xcode 12.2 running on Mac Mini M1 (Big Sur) Added SDWebImageSwiftUI v1.5.0 via Swift Package Manager

sample usage:

import SwiftUI
import SDWebImageSwiftUI

struct MainView: View {
      ....
      ....
}

Error pops up when building (target device: iPhone 8 (14.3) simulator)

Tried:

color123 commented 3 years ago

Seems to work when targeting simulator < 14.3 (e.g. 13.0)

dreampiggy commented 3 years ago

Mac Mini M1 can only run arm64-apple-ios-simulator.

Because iPhone Simulator on your ARM Mac, can only run arm code, not Intel Mac's x86_64 code.

Can you have a detailed log (use Xcode's Log Navigator's export button) to export the thing for this ? Or try reset all the simulator and restart Mac, using: xcrun simctl erase all

color123 commented 3 years ago

Here's the exported log from Xcode...

Build target TestAPp (iOS)_2021-01-05T22-06-18.txt

color123 commented 3 years ago

Additional update.. For some reason it works on an iPad Air 4th gen simulator running 14.3

color123 commented 3 years ago

Also tried resetting the simulator and restarting mac using: xcrun simctl erase all but still same error shows up

dreampiggy commented 3 years ago

Sounds a strange issue. I can not reproduce on my own Mac environment.

Can you use the Carthage/CocoaPods package manager to test again ? I guess something bug in SwiftPM itself, not our SDK can do.

dreampiggy commented 3 years ago

Could not reproduce. If anyone found ways or reason, PR is welcomed.

kisspt commented 2 years ago

我遇到了同样的问题,现在有解决办法吗?

mknippen commented 2 years ago

I also have this issue, only seems to be affecting M1 Macs. This is true on my M1 Pro Max MacBook Pro

mknippen commented 2 years ago

This seemed to have worked as a workaround for Cocoapods by adding this to the end of your Podfile:

post_install do |installer|
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            # Needed for building for simulator on M1 Macs
            config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO'
        end
    end
end
embassem commented 2 years ago

still have the issue using Macbook pro With M1 pro and Xcode 13.2 installed using SPM

elhak commented 2 years ago

still have the issue using Macbook pro With M1 Could not find module 'SDWebImageSwiftUI' for target 'x86_64-apple-ios-simulator'; found: arm64-apple-ios-simulator