Answering my own question. I fixed the ffi issue by uninstalling my faulty Ruby version and CocoaPods, then I used the -x86_64 arch to reinstall ffi and CocoaPods.
These are the steps I did to get back to a working state (and to apply the M1 workarounds for ffi):
- Uninstall Ruby with:
brew uninstall ruby --force
- Uninstall CocoaPods. At first, try to list all CocoaPods versions / components with
gem list --local | grep cocoapods
. Then uninstall them one by one, in my case:
sudo gem uninstall cocoapods
sudo gem uninstall cocoapods-core
sudo gem uninstall cocoapods-downloader
etc.
- As a next step I was able to reinstall ffi and then CocoaPods with:
sudo arch -x86_64 gem install ffi
sudo arch -x86_64 gem install cocoapods
Once done, I could run pod install
as expected. Note that I had the Terminal open all the time in standard mode – no Rosetta required.
Then, run the following command in iOS folder to execute pod install.
arch -x86_64 pod install
Could not build the precompiled application for the device.
Error (Xcode): No profiles for ‘fyi.yuan.receiptBubble’ were found: Xcode couldn’t find any iOS App Development provisioning profiles matching ‘fyi.yuan.receiptBubble’. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild.
/Users/yinhuanyuan/StudioProjects/receipt_bubble/ios/Runner.xcodeproj
“iproxy” cannot be opened because the developer cannot be verified
I finally found this could fix, first switch to the folder of flutter(change the path to your own flutter path):
cd FLUTTER SDK DIRECTORY/flutter/bin/cache/artifacts/usbmuxd
then execute this command:
sudo xattr -d com.apple.quarantine iproxy