如果你使用了 Xcode 15.3 以上的版本,並且專案中使用了 Firebase,請注意 Firebase 版本要升到 10.22.0 以上,否則發佈後會閃退。

Crashlytics report on xcode15.4 vs. firebase 10.10.0

7月初,團隊講好一起把 Xcode 升到 15.4 以上,其他的 pods 都是固定的,然後一線,閃退率就起來了,上面的圖就是上線後的結果。

看了 Crashlytics,發生閃退的地方是 AppDelegate 而且是 Compiler generated code。

Crash starts from AppDelegate

看了一下 stack overflow 的資訊,有提到的是這篇。

Stack overflow 查到可能閃退的點,並且建議升級到 Firebase 10.22.0 以上

Firebase github issues - 11403 有提到一系列原因

原因和我專案上的類似,和 nanopb 有關。

如果升到 Xcode 15.3 以上的版本

請一定要檢查 Firebase 的版本是不是在 10.22.0 以上

Crash log

Crashed: com.apple.main-thread
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x000000017338126c
0
nanopb
encode_field + 100
24
UIKitCore
keypath_get_selector_hoverStyle + 11024
25
<compiler-generated> - Line 4337149088
static AppDelegate.$main() + 4337149088
26
<compiler-generated> - Line 4337152352
type metadata accessor for AppDelegate + 4337152352

Updated: