我有Flutter 项目,我试图运行iOS版本,但我得到错误后,我更新Flutter 和Xcode到最新版本,我使用Firebase核心插件

错误:

Could not build the precompiled application for the device.
Error (Xcode): File not found: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphoneos.a

Error (Xcode): Linker command failed with exit code 1 (use -v to see invocation)

以下是以下内容:

# Uncomment this line to define a global platform for your project
# platform :ios, '12.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

我还try 通过以下方式安装所有Pod:

pod deintegrate
rm Podfile.lock
rm -rf Pods

然后更新存储库并安装Pod,我仍然收到相同的错误,我应该重新安装Xcode吗?

Flutter 套餐:

firebase_core: ^2.8.0
firebase_crashlytics: ^3.0.17
firebase_analytics: ^10.1.6
firebase_messaging: ^14.3.0

有解决此问题的方法吗?感谢您抽出时间来

推荐答案

我解决了这个问题,尽管我不确定这是不是一个好的解决方案, 运行以下命令:

pod deintegrate
pod install
pod repo update
pod install (again)

只需在Xcode中打开Ffltter项目中的iOS项目,转到文件夹(文件)选项卡中的Pods,转到目标,转到导致问题的目标(我猜是Pod,一个依赖项)to 13.0,并try 通过构建应用程序并在Xcode中运行它,或者在选定的iOS设备上使用Ffltter Run来再次运行应用程序,问题应该就会消失

然而,有时当你在Ffltter中清理项目(使用flutter clean)时,它会重置这些更改,或者当你删除Pod并解除Cocapods并重新安装应用程序时,所有更改都会恢复到默认设置,这并不是一个真正有效的解决方案,但至少你可以运行该应用程序

编辑:这个解决方案的 idea ,都要感谢@思域

Ios相关问答推荐

带外部笔划的圆形进度视图

设置托管在DigitalOcean上的iOS通用链接

SwiftData在获取值时应用程序崩溃:线程1:EXC_BREAKPOINT(代码=1,子代码=0x101e8303c)

如何在Swift中同时实现三个手势?

如何通过点击按钮滚动到 ScrollView 中的特定视图?

UIView 倒置旋转时的zoom 问题

更改图标会导致 SwiftUI 动画出现故障?

工具栏底部 iOS 16 - SwiftUI

如何仅更改一个视图的导航标题 colored颜色 ?

从视图模型中更新 EnvironmentObject

通过隐藏和显示视图在 iMessage 应用程序中使用不同的视图

如何避免任何绑定空错误并更好地获取代码

导航控制器自定义过渡动画

如何判断是否为 64 位构建了静态库?

如何在上传到服务器之前在 iOS 上压缩/调整图像大小?

在 iPhone 应用程序中使用 SSL - 出口合规性

针对 Xcode 中的 iPad 选项

如何获取 iTunes 连接团队 ID 和团队名称?

我可以通过 UIAppearance 代理设置哪些属性?

你如何以编程方式从视图控制器中画一条线?