解决Error (Xcode): File not found:XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphoneos.a

简介: 解决Error (Xcode): File not found:XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphoneos.a

出现场景

一个老项目在最新的Xcode14.3运行报以下错误。

Launching lib/main.dart on iPhone in debug mode...
Automatically signing iOS for device deployment using specified development team in Xcode project: YE6STNG83Y
Running Xcode build...
Xcode build done.                                            8.9s
Failed to build iOS app
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)


Error launching application on iPhone.

根据网上的资料,这是由于 Xcode14只支持构建ios11.0及以上的版本。libarclite对于老的版本才需要,在IOS11以上被废弃了。所以我们要确保所有的库的构建目标都要在11.0以上。

解决方案

方案1

打开Xcode, 选中Pods,查看Targets中库有哪些是大于11.0的,改为11.0。然后重新运行即可。

方案2

如果方案1不行,那就手动添加以下代码到Podfile中,然后重新编译。

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'] = '13.0'
         end
    end
  end
end
相关文章
|
iOS开发
Xcode报错解决方法:ld: symbol(s) not found for architecture arm64
Xcode报错解决方法:ld: symbol(s) not found for architecture arm64
3144 0
|
5月前
|
iOS开发 Perl
Xcode 10.2.1 Error:library not found for -lstdc++.6.0.9
Xcode 10.2.1 Error:library not found for -lstdc++.6.0.9
51 0
|
Java iOS开发
Mac编译OpenJDK8:configure: error: Xcode 4 is required to build JDK 8, the version found was 10.1config
Mac编译OpenJDK8:configure: error: Xcode 4 is required to build JDK 8, the version found was 10.1config
130 0
|
iOS开发
未解决:configure: error: XCode tool ‘metal‘ neither found in path nor with xcrunchecking for metal...
未解决:configure: error: XCode tool ‘metal‘ neither found in path nor with xcrunchecking for metal...
175 0
Xcode12.x报错: ld: library not found for -lstdc++.6.0.9
错误信息: ld: library not found for -lstdc++.6.0.9 报错原因:Xcode10移除了动态库libstdc
271 0
Command /Applications/Xcode.app/Contents/Developer/usr/bin/copypng failed with exit code 1错误解决办法
Command /Applications/Xcode.app/Contents/Developer/usr/bin/copypng failed with exit code 1错误解决办法
128 0
|
开发工具 iOS开发 Perl
Xcode10再坑之framework not found CoreServices for architecture armv7
1、前言 前段时间,升级了 Xcode10 后,提供给第三方用户的SDK,客户反馈说报错: ld: framework not found CoreServices for architecture armv7 为什么 iOS SDK 拖入项目中就报错"ld: framework not fou...
4731 0
|
iOS开发
Xcode 10: third-party: 'config.h' file not found
升级xcode到10版本之后 遇到 config.h 文件找不到的问题 In the Terminal, navigate to the react-native/third-party/glog folder inside node_modules...
1580 0
|
前端开发 iOS开发 移动开发
Xcode 10: Build input file double-conversion cannot be found
升级到xcode10之后 ReactNative项目启动报错如下: error: Build input file cannot be found: '/Users/rod/dev/react/testing/awesome/node_modules/react-native/third-party/double-conversion-1.
3266 0