Xcode延續(xù)了它經(jīng)久不變的負(fù)優(yōu)化+臃腫策略,一更新就出各種幺蛾子,這次主要是加強(qiáng)了軟件安全的檢測。我司老掉牙的項(xiàng)目運(yùn)行沒問題,凡是上傳就報(bào)錯(cuò),如下:
報(bào)錯(cuò):打包Adhoc沒問題,但是上傳AppStoreConnect或者TestFlight就不行

QQ_1731998028897.png
報(bào)錯(cuò)內(nèi)容大概是說,我通過cocoapods引入的某個(gè)第三方庫,enableBitcode為true,大家知道bitcode其實(shí)在Xcode 14的時(shí)候已經(jīng)被廢棄了。Xcode 16可能更為嚴(yán)格一些,目前來說在Xcode 15上面依然能夠成功上傳的,但Xcode 16不行。
解決方案:
post_install do |installer|
bitcode_strip_path = `xcrun --find bitcode_strip`.chop!
def strip_bitcode_from_framework(bitcode_strip_path, framework_relative_path)
framework_path = File.join(Dir.pwd, framework_relative_path)
command = "#{bitcode_strip_path} #{framework_path} -r -o #{framework_path}"
puts "Stripping bitcode: #{command}"
system(command)
end
# 報(bào)錯(cuò)的SDK找到目錄放到這
framework_paths = [
"Pods/LibraryA/LibraryA/dynamic/LibraryA.xcframework/ios-arm64_armv7/LibraryA.framework/LibraryA",
"Pods/LibraryB/LibraryB.xcframework/ios-arm64_armv7/LibraryB.framework/LibraryB"
]
framework_paths.each do |framework_relative_path|
strip_bitcode_from_framework(bitcode_strip_path, framework_relative_path)
end
end
然后重新pod install,重新打包上傳就沒問題了
下面是警告:

QQ_1731997997266.png
暫時(shí)未解決,想著反正沒幾個(gè)人用,懶得折騰了,嘿嘿
參考資料:
https://blog.csdn.net/qinqi376990311/article/details/142493593?