记录近期iOS开发几个报错及解决方案

记录近期iOS开发几个报错~

1、报错:SDK does not contain 'libarclite' at the path '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphonesimulator.a'; try increasing the minimum deployment target

原因分析:

通常是因为CocoaPods管理的第三方库版本过低导致的不兼容异常。

解决方案:

在配置文件Podfile中加入相关配置,控制第三方库的版本。

示例如下:

objectivec 复制代码
target 'YourApp' do
  use_frameworks!
  
  pod 'MJRefresh'
  
  post_install do |installer|
    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
end

修改完Podfile之后,记得pod update一下。

2、报错:Sandbox: rsync.samba(3582) deny(1) file-write-create /Users/x/Library/Developer/Xcode/DerivedData/Qus-dibsjxxpnpyfighcpwxobfjicuuq/Build/Products/Debug-iphonesimulator/Qus/Frameworks/ActiveLabel.framework/_CodeSignature

原因分析:

构建或同步过程可能尝试执行一个被沙箱限制的操作

解决方案:

禁用沙箱限制:Targets -> Build Settings -> User Script Sandoxing, 改为NO

3、报错:Logging Error: Failed to initialize logging system. Log messages may be missing. If this issue persists, try setting IDEPreferLogStreaming=YES in the active scheme actions environment variables.

原因分析:

Xcode 的日志系统无法初始化

解决方案:

设置Xcode优先启用日志流功能,绕过初始化失败:

  1. 在 Xcode 中,打开你的项目设置,选择相应的 Scheme。
  2. 进入 Scheme 编辑器,选择 "Run" 或 "Test" 选项卡。
  3. 在 "Arguments" 部分,添加 IDEPreferLogStreaming 环境变量并将其值设置为 YES。

4、报错:[Client] Sending selectors failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service named com.apple.commcenter.coretelephony.xpc was invalidated.}

原因分析:

原因很多,很繁琐,总而言之,不关自己项目的事,要想去除警告参加下面方法。

  1. 终端输入【命令1】:
powershell 复制代码
xcrun simctl spawn booted log config --mode "level:off" --subsystem com.apple.CoreTelephony
  1. 报错xcrun: error: unable to find utility "simctl", not a developer tool or in PATH ,说明 xcode-select 指向没有正确的 Xcode 目录,终端下面【命令2】:
powershell 复制代码
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
  1. 查看路径【命令3】:
powershell 复制代码
xcode-select --print-path
  1. 没问题了重复执行【命令1】,正常到这里就OK了。
相关推荐
文件夹__iOS6 小时前
SwiftUI 核心选型:class + ObservableObject VS struct + @State
ios·swiftui·swift
SameX12 小时前
独立开发了一款健康记录 App,聊聊几个让我纠结很久的设计决策
ios
报错小能手12 小时前
Swift UI 框架 实战 简易计数器、待办清单 、随机壁纸图库、个人笔记
ui·ios
游戏开发爱好者814 小时前
深入理解iOSTime Profiler:提升iOS应用性能的关键工具
android·ios·小程序·https·uni-app·iphone·webview
for_ever_love__1 天前
UI学习:多界面传值的正向传值(属性传值)和反向传值(代理传值)
学习·ui·ios·objective-c
开心就好20251 天前
全面介绍iOS开发工具:Xcode、AppCode、CocoaPods、Fastlane和Git
后端·ios
懋学的前端攻城狮1 天前
数据持久化与缓存策略:在离线与在线间架起桥梁
ios·swift
~央千澈~1 天前
以cocos3.8.8开发的游戏为例商业实战项目举例cocos打包ios苹果安装包ipa完整详细教程-优雅草卓伊凡
ios
SameX2 天前
iOS 足迹 App 的成就系统,我推倒重做了一次——踩了3个坑之后
ios
SameX2 天前
我做了一个把专注计时变成「声音护照」的 iOS App,聊聊数据可视化和成长系统的设计思路
ios