Redefinition of module 'FFI'
felix-schindler opened this issue · 4 comments
Describe the bug
Hey, I'm not sure wether I'm doing something wrong or this is an actual bug. Maybe you can help me out. I've followed the tutorial for macOS and can't start the Template project because of the error described in the title.
My OS: macOS 14.4.1 23E224 arm64
To Reproduce
Follow the tutorial for macOS.
Expected behavior
The Template project should build without any compile errors.
Additional context
No response
Thanks for reaching out! Have you tried this fix:
Thanks for opening the issue, @litewrap! I experienced this as well when testing on macOS. Here is what works for me:
- Clean the build folder (Xcode:
Product > Clean Build Folder...
).- Reset package caches (Xcode:
File > Packages > Reset Package Caches
)- Delete the
DerivedData
folder (~/Library/Developer/Xcode/DerivedData
)- Run the following command in a terminal:
sed -i '' 's/-I..includedir.//g' $(brew --prefix)/Library/Homebrew/os/mac/pkgconfig/*/libffi.pc
- Resolve package versions (Xcode:
File > Packages > Resolve Package Versions
)- Run the app. Now, it succeeds.
I'm not sure whether every step is strictly necessary. Does that help in your case?
I first experienced this problem here: stackotter/swift-cross-ui#47
It's a macOS only problem that sometimes occurs and sometimes doesn't. If this works for you, I'll add the link to the README. Note that this package works best on Linux.
Works!
I hit this as well. Its still an occuring issue in xcode. Despite issues in other related repos claiming it was fixed back in 2023. Look out for this if you use xcode. These instructions do work.
This workaround works for me too :) THX, I suppose that issue between SDK from Xcode and Adwaita from Homebrew :)