IOS开发之——项目中遇到的问题及解决办法

一 概述

本文介绍IOS开发中遇到的问题及解决办法,并长期更新

二 问题及解决办法

2.1 Ignoring ffi-1.14.2 because its extensions are not built

错误现象

1
2
3
4
5
6
7
8
9
10
11
Ignoring ffi-1.14.2 because its extensions are not built. Try: gem pristine ffi --version 1.14.2
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface/error_report.rb:34:in `force_encoding': can't modify frozen String (FrozenError)
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface/error_report.rb:34:in `report'
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:66:in `report_error'
from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:396:in `handle_exception'
from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:337:in `rescue in run'
from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:324:in `run'
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:52:in `run'
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/bin/pod:55:in `<top (required)>'
from /usr/local/bin/pod:23:in `load'
from /usr/local/bin/pod:23:in `<main>'

解决办法

根据提示安装对应版本的ffi

1
sudo gem pristine ffi --version 1.14.2

2.2 Library/Ruby/Gems/2.6.0/gems/cocoapods...

现象

1
2
3
4
5
6
7
8
9
10
11
macbook-pro-zxc:AFDemo zxc$ pod init
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface/error_report.rb:34:in `force_encoding': can't modify frozen String (FrozenError)
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface/error_report.rb:34:in `report'
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:66:in `report_error'
from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:396:in `handle_exception'
from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:337:in `rescue in run'
from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:324:in `run'
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:52:in `run'
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/bin/pod:55:in `<top (required)>'
from /usr/local/bin/pod:23:in `load'
from /usr/local/bin/pod:23:in `<main>'

解决办法

将Project Format从Xcoce 14.0-compatible设置为Xcode 13.0-compatible

2.3 Framework not found xxx

错误现象

1
Framework not found AFNetworking

解决办法

使用Xcode打开xxx.xcworkspace而不是xxx.xcodeproj

2.4 File not found: .../usr/lib/arc/libarclite_iphonesimulator.a

错误现象

1
File not found: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphonesimulator.a

解决办法

下载arc文件夹 解压缩或者从旧版本 Xcode 复制并将 arc文件夹 拷贝到

1
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/

三 参考

  • Xcode14.3 File not found libarclite_iphonesimulator.a and libarclite_iphoneos.a
  • Ignoring ffi-1.14.2 because its extensions