LeonardoCardoso / SwiftLinkPreview

It makes a preview from an URL, grabbing all the information such as title, relevant texts and images.
https://leocardz.com/swift-link-preview-5a9860c7756f
MIT License
1.37k stars 196 forks source link

Could not find module 'SwiftLinkPreview' for target 'x86_64-apple-ios-simulator'; found: arm64, arm64-apple-ios-simulator` #137

Closed dastan1302 closed 2 years ago

dastan1302 commented 3 years ago

Getting this error when running on Intel and M1 both macs with xcode 12.4, on latest OS BigSur

LeonardoCardoso commented 2 years ago

I'm closing this issue because I couldn't reproduce. Are you still having this problem?

eliburke commented 2 years ago

I got this error too, with XCode 13. Runs on a device but I can't run an x86_64 simulator build (and I don't have an M1 Mac handy)

I've cleaned out my DerivedData and artifacts, and built using Carthage: carthage update --platform iOS --no-use-binaries --cache-builds --use-xcframeworks

Problem occurs when I run: Could not find module 'SwiftLinkPreview' for target 'x86_64-apple-ios-simulator'; found: arm64, arm64-apple-ios-simulator, at: ~/Library/Developer/Xcode/DerivedData/APP_BUILD_DIRECTORY/Build/Products/Debug-iphonesimulator/SwiftLinkPreview.framework/Modules/SwiftLinkPreview.swiftmodule

I was able to resolve the problem by removing the "user-defined" VALID_ARCHS lines from the xcodeproj file. It was not sufficient to remove it in the GUI I had to manually remove from every configuration. I believe this is an old setting that was needed back in the day. #154 fixes.

eliburke commented 2 years ago

This is peripherally mentioned in the XCode 12 release notes: https://developer.apple.com/documentation/xcode-release-notes/xcode-12-release-notes

The Build Settings editor no longer includes the Valid Architectures build setting (VALID_ARCHS), and its use is discouraged. Instead, there is a new Excluded Architectures build setting (EXCLUDED_ARCHS). If a project includes VALID_ARCHS, the setting is displayed in the User-Defined section of the Build Settings editor. (15145028)

Samigos commented 2 years ago

I just got my first M1 mac and I get the exact same error! What is the fix here?

eliburke commented 2 years ago

It's right there in my comment along with a merge request. You can pin to my branch or fork and fix it for yourself.

Samigos commented 2 years ago

I tried pinning the pod to your branch (valid_archs), but cocoapods failed to find it! Indeed, there’s no branch with that name!

eliburke commented 2 years ago

Ah sorry... I'm used to Carthage which lets you easily point to different repos. I can't help you any further than google but maybe check out "cocoapods private repo"

https://guides.cocoapods.org/making/private-cocoapods.html