Xcode15踩坑记录

743 阅读1分钟

一、 21 duplicate symbols

image.png

解决方法:Build Setting -> Other Linker Flag,新增一项:-ld64,即可解决这个编译报错

二、 rsync error: some files could not be transferred (code 23) at /AppleInternal/Library/BuildRoots/ec9ec6a1-21b0-11ee-8c40-aead88ae2785/Library/Caches/com.apple.xbs/Sources/rsync/rsync/main.c(996) [sender=2.6.9]

解决方法: 全局搜索 readlink找到 Pods-xxx-frameworks文件,进行如下操作: 找到该行代码

在readlink后增加 -f

即可解决该报错问题,需要注意的是,这个问题在Xcode14.3.1上就已经出现了,Xcode15同样存在。

三、Assertion failed

Assertion failed: (false && "compact unwind compressed function offset doesn't fit in 24 bits"), function operator(), file Layout.cpp, line 5758.

此错误信息看的一脸懵逼,找了好多答案告诉你OTHER_LDFLAGS中添加 “-ld64” 但是在自己项目中添加是没有任何用的,最后发现在对应报错的SDK中添加可以解决这个问题 如下

#podfile里添加
post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
     target.build_configurations.each do |config|
                       if target.name == "alipay_kit_ios"
                             config.build_settings['OTHER_LDFLAGS'] = "-ld64 #{config.build_settings['OTHER_LDFLAGS']}"
                        end
                    end
  end
end

四、iconv2.4.0"not found

ld: library not found for -liconv.2.4.0
clang: error: linker command failed with exit code 1 (use -v to see invocation)

网上很多答案告诉你OTHER_LDFLAGS中添加 “-ld64”
这个方法之前对我有用,后不知什么原因突然失效了。检查发现Pods-*.debug 与release 中有 "liconv.2.4.0" -l手动删除掉运行正常。
次方法也只是暂时解决,再下次pod install 的时候,还会重置,需要重新删除操作。目前也没发现有好的方法,若有好的建议请告知,相互学习!