Xcode15问题点记录

作者: 柠檬不争 | 来源:发表于2023-09-20 11:08 被阅读0次

更新到Xcode15,适配之前的代码,记录当前遇到的问题和解决方法。

1.WebKit错误

error: type argument 'nw_proxy_config_t' (aka 'struct nw_proxy_config *') is neither an Objective-C object nor a block type
@property (nullable, nonatomic, copy) NSArray<nw_proxy_config_t> *proxyConfigurations NS_REFINED_FOR_SWIFT API_AVAILABLE(macos(14.0), ios(17.0));
                                              ^~~~~~~~~~~~~~~~~
1 error generated.
WebViewJavascriptBridge/WebViewJavascriptBridge/WKWebViewJavascriptBridge.h:16:9: fatal error: could not build module 'WebKit'
#import <WebKit/WebKit.h>

这里主要要搜索“nw_proxy_config_t”关键字,建议不要用百度搜索,有点坑,用谷歌或者必应进行搜索。
解决方法:
1.选中不能编译的库的xcodeproj,在Build Phrases -> Compile Sources,选中所有文件,逐一在Complier Flags 里删除 -DOS_OBJECT_USE_OBJC=0。
如图:

webBug.png

2.缺失 libarclite_iphoneos.a

报错:

找不到文件:/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphoneos.a

解决方法:
因为需要指定版本到有特殊要求,可以考虑从其他版本的Xcode拷贝
使用访达,文件前往:

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

在这个路径下新建一个 usr 文件夹,放入链接下载的文件,即可。
文件链接:https://gitee.com/TikBai_admin/Libarclite-Files.git

存放路径.png

3. duplicate symbols && Assertion failed

报错信息:

ld: 1 duplicate symbols
clang: error: linker command failed with exit code 1 (use -v to see invocation)

或者:

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

解决方法:
在other link flags添加 -ld64
Build Settings -> Linking - General -> Other Link Flags 添加-ld64 或者 -ld_classic

如图:


duplicate.png

4.打包报错Command PhaseScriptExecution failed with a nonzero exit code

解决方法:
找到Pods-xxxx-frameworks.sh文件,替换代码:

#    source="$(readlink "${source}")"
     source="$(readlink -f "${source}")"

如图所示:


打包编译报错.png

5.打包报错腾讯IM:Asset validation failed

报错信息:

/Frameworks/TUIGroup.framework' is missing plist key.The
Info.plist file is missing the required key:CFBundleShortVersionString.Please find more
information about CFBundleShortVersionString at https://developer.apple.com/
documentation/bundleresources/information_property_list/cfbundleshortversionstring(ID:
0627ef87-66c9-428b-b36b-69178374702c

如图所示:


打包im报错.png

解决方法:
通过添加腾讯IM相关的技术人员解决


腾讯解决.png
在 podfile 最后一个 end 后面,添加下这个看看

#Pods config
#Fix Xcode14 Bundle target error
post_install do |installer|
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|            
            config.build_settings['GENERATE_INFOPLIST_FILE'] = "NO"
        end
    end
end

参考链接:
iOS17适配Xcode15问题
Xcode版本升级build报错问题
集成腾讯IMSDK后打包上架报错

相关文章

网友评论

    本文标题:Xcode15问题点记录

    本文链接:https://www.haomeiwen.com/subject/lsgovdtx.html