Porting apps to mac is finally possible thanks to Catalyst, problem is, numerous pods don't support AppKit.
Most common one would be Crashlytics / Firebase.
In [...]/Pods/Crashlytics/iOS/Crashlytics.framework/Crashlytics(CLSInternalReport.o), building for Mac Catalyst, but linking in object file built for iOS Simulator, file '[...]/Pods/Crashlytics/iOS/Crashlytics.framework/Crashlytics' for architecture x86_64
Since it's a recent topic, I couldn't find doc on how to remove a pod from my build for macOS but keep it for iOS and iPadOS.
It is possible to use in code:
#if !targetEnvironment(macCatalyst)
// Code to exclude for your macOS app
#endif
But that one part of the problem, the other part is to link the pod only for iOS...
What would be the easiest/best course of action when the library is not vital for macOS but still wanted on iOS?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…