我想用 Flutter 和 Firebase 創建一個跨平臺的應用程式。我希望該應用程式可以在 iOS、Android、macOS 上運行并作為 Web 應用程式運行。
這是我的問題:
當我嘗試在 Web 中運行 Flutter 應用程式時一切正常,但是當我嘗試將它作為 macOS 應用程式或作為模擬器上的 iOS 應用程式運行時會pod install
崩潰。這些是崩潰的日志:pod install crash log。
我已經嘗試過這樣做pod repo update
,但是由于基本相同的日志而崩潰:pod repo update crash log。
這是生成的 Podfile Flutter:
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}
def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
flutter_ios_podfile_setup
target 'Runner' do
use_frameworks!
use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
uj5u.com熱心網友回復:
我認為安裝的 ffi 有問題..
首先嘗試通過以下方式進行 pod install
arch -x86_64 pod install
如果失敗,則使用此命令重新安裝 ffi
arch -x86_64 sudo gem install ffi
然后嘗試
arch -x86_64 pod install
然后嘗試再次構建
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/504403.html