Xcode 14.3与cocoapods一些坑

坑一:

编译时候出现

Could not build the precompiled application fon the device. Error (xcode):
filenot found: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphoneos.a

问题是cocoapods,里面库的iOS Deployment Target版本设置问题。

解决方案:

方案一:手动去Pods的TARGETS,选中所有库改Build Settings里面的iOS Deployment Target版本。

方案二:在Podfile,新增以下内容

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'] = '11.0'

        end

    end

  end

end

相关文章:https://blog.csdn.net/crasowas/article/details/129901398


坑二:

打包的时候出现

sent 29 bytes received 20 bytes 98.00 bytes/sec

total size is 0  speedup is 0.00

rsync error: some files could not be transferred (code 23) at /AppleInternal/Library/BuildRoots/97f6331a-ba75-11ed-a4bc-863efbbaf80d/Library/Caches/com.apple.xbs/Sources/rsync/rsync/main.c(996) [sender=2.6.9]

Command PhaseScriptExecution failed with a nonzero exit code

解决方案:

1、找到APP目录下Pods/Target Support Files/Pods-APP项目名/Pods-APP项目名-frameworks.sh

2、打开后找到 source="$(readlink "${source}")" 替换为 source="$(readlink -f "${source}")"

相关文章:https://developer.apple.com/forums/thread/725230?answerId=746897022#746897022


坑三:

Xcode 14.3打包,iOS13闪退。

闪退条件:

1、Swift编写的项目(同一时间打包,OC写的老项目暂时没出现)

2、Xcode 14.3打包,注意是打包推送到TestFlight或者App Store。试过本地编译调试都不会闪退。也试过跟debug和release包无关。

3、运行的设备是iOS 13大版本,不管是13.1~13.6都会(暂时没有13.0机器),试过其他12/14/15/16都正常。

导出来闪退日志如下:

Exception Type: EXC_CRASH (SIGABRT)

Exception Codes: 0x0000000000000000, 0x0000000000000000

Exception Note:  EXC_CORPSE_NOTIFY

Termination Description: DYLD, Assertion failed: (gotLocation), function applyFixupsToImage_block_invoke_3, file /BuildRoot/Library/Caches/com.apple.xbs/Sources/dyld/dyld-733.3.1/dyld3/Loading.cpp, line 779.

Highlighted by Thread:  0

Backtrace not available

Unknown thread crashed with ARM Thread State (64-bit):

    x0: 0x0000000000000006  x1: 0x0000000000000009  x2: 0x000000016d39c1e0  x3: 0x0000000000000014

    x4: 0x000000016d39bde0  x5: 0x0000000000000000  x6: 0x000000016d39cb50  x7: 0x000000016d39cc68

    x8: 0x0000000000000020  x9: 0x0000000000000009  x10: 0x646c79642f312e33  x11: 0x6e6964616f4c2f33

  x12: 0x2f33646c79642f31  x13: 0x2e676e6964616f4c  x14: 0x6e696c202c707063  x15: 0x000a2e3937372065

  x16: 0x0000000000000209  x17: 0x0000000000000048  x18: 0x0000000000000000  x19: 0x0000000000000000

  x20: 0x000000016d39bde0  x21: 0x0000000000000014  x22: 0x000000016d39c1e0  x23: 0x0000000000000009

  x24: 0x0000000000000006  x25: 0x0000000000000389  x26: 0x0000000000000303  x27: 0x000000010306e4b0

  x28: 0x0000000000117cf0  fp: 0x000000016d39bdb0  lr: 0x00000001032c2498

    sp: 0x000000016d39bd70  pc: 0x00000001032bb5e4 cpsr: 0x40000000

  esr: 0x00000000  Address size fault

Binary images description not available

Error Formulating Crash Report:

Failed to create CSSymbolicatorRef - corpse still valid ¯\_(ツ)_/¯

EOF

解决方案:

相同代码,换了另一台电脑,在Xcode 14.2下打包重新上线就可以了。

至于后续,暂时未知,出问题围观此处:https://developer.apple.com/forums/thread/727680

你可能感兴趣的:(Xcode 14.3与cocoapods一些坑)