最近入手了蘋(píng)果M1芯片筆記本,使用感受就是,芯片的強(qiáng)大能力,但是是適配是個(gè)問(wèn)題,有些庫(kù),有些軟件,如果廠家沒(méi)去適配,那勢(shì)必會(huì)引起一起問(wèn)題,還有些軟件使用時(shí)候,也得用不同與Inte的方法,一下就是幾個(gè)碰到的坑
關(guān)于 m1 xcode12 編譯報(bào)錯(cuò) this target. for architecture arm64,M1模擬器編譯不通過(guò),等問(wèn)題解決方案
第1步:
Build Setting中在Excluded Architectures對(duì)模擬器添加arm64

第2步:
Podfile文件中添加以下代碼,然后pod install
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
end

第3步:
Clean工程,重新編譯即可。
如果這個(gè)方法也還是編譯不通過(guò),可以試一試下面這個(gè)方法
解決方案:
1.打開(kāi)訪達(dá),選擇應(yīng)用程序,右鍵打開(kāi)xcode簡(jiǎn)介

選擇打開(kāi)ressta 即可

再重新運(yùn)行項(xiàng)目,基本沒(méi)啥問(wèn)題了
macOS Big sur pod install失敗
macOS Big sur系統(tǒng)上運(yùn)行pod install命令行報(bào)錯(cuò):
-- Crash Report log information --------------------------------------------
See Crash Report log file under the one of following:
* ~/Library/Logs/DiagnosticReports
* /Library/Logs/DiagnosticReports
for more details.
Don't forget to include the above Crash Report log file in bug reports.
命令行中執(zhí)行以下命令行即可
sudo arch -x86_64 gem install ffi
arch -x86_64 pod install
原因可能是Ruby的FFI庫(kù)是一個(gè)gem,用于以編程方式加載動(dòng)態(tài)鏈接的本地庫(kù),在其中綁定函數(shù),并從 Ruby 代碼調(diào)用這些函數(shù)。(原文:Ruby-FFI is a gem for programmatically loading dynamically-linked native libraries, binding functions within them, and calling those functions from Ruby code.)
這個(gè)在我的M1芯片環(huán)境是可以使用的,如果不加前綴arch -x86_64,會(huì)失敗