我最近把iPhone升级到了iOS16.4,把Xcode升级到了13.4.自从更新以来,我在try 用Xcode构建iOS应用程序时遇到了一个错误.错误消息如下:

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)

此问题在更新到iOS 16.4和Xcode 13.4后开始出现.

我试过:

  1. 整齐地运行Flutter
  2. 重新启动系统
  3. 重新启动iOS设备

https://stackoverflow.com/a/68651798

推荐答案

在升级了手机上的iOS后,我也无法构建16.4版本.因为Xcode还不支持16.4.

今天,Xcode的新版本发布了.我想它会解决这个问题.

但是,我通过执行以下操作解决了这个问题:

从Apple开发者网站下载并解压Xcode Release Candidate 3(RC3).然后,你必须右击解压出来的应用程序,然后 Select [显示包内容].然后,您需要在当前安装的Xcode版本中将文件从Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/16.4复制到Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport.

enter image description here

如上所述,新版本可能会修复这个问题,但这个变通方法可能会对future 的iOS更新有用.

UPDATE:

最新版本的Xcode(14.3)给我带来了同样的问题.我修改了我的ios/Podfile,将部署目标的级别设置为11.0,从而修复了这个问题.

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
  end

  installer.generated_projects.each do |project|
    project.targets.each do |target|
            target.build_configurations.each do |config|
                config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
            end
        end
    end
end

Ios相关问答推荐

如何在SwiftUI中扩展双击的可检测区域?

如何在HStack中将sfsymbol与Text视图对齐?

Xcode 15模拟器用x86_64编译

如何使用 SwiftData 从列表中删除子项目?

iOS 16.4,SwiftUI 底部工作表有时会忽略presentationDetents

SwiftUI:.toolbar 不适用于 UITextView

封装 Swift 导入

Swift UI中如何为Text提供内部填充

如何在 SwiftUI 中对表格行使用 Transferable

Xcode14 启动时崩溃:dyld:库未加载:/usr/lib/swift/libswiftCoreGraphics.dylib

List touch Tabbar 时 SwiftUI Tabbar 消失

具有多个目标的应用程序的动态内容

将值传递给导航链接视图中的文本框

SwiftUI 视图 - viewDidLoad()?

如何在react 导航中获取当前路由名称?

@IBDesignable 崩溃代理

iPhone 未连接.连接 iPhone 后 Xcode 将继续

将自定义对象保存到 NSUserDefaults

Select 器touchesBegan:withEvent:的覆盖方法具有不兼容的类型(NSSet,UIEvent)->()

如何使用 AFNetworking 设置超时