Class IOSMacCatalystPatches
Problem. Firebase 11.14.0+ makes GoogleAdsOnDeviceConversion.xcframework a required transitive dependency of GoogleAppMeasurement/Default, but the xcframework ships only iOS-device and iOS-simulator slices -- no Mac Catalyst slice. Building for "My Mac (Mac Catalyst)" fails at link time with "Framework 'GoogleAdsOnDeviceConversion' not found". See firebase-ios-sdk#14995.
Why we patch post-build. cordova build ios internally re-runs cordova prepare, which regenerates the Podfile, which fires cordova-plugin-firebasex-core's after_prepare hook, which runs pod install and regenerates both the aggregate xcconfigs and Pods.xcodeproj. Any modification done BEFORE cordova build is wiped. This class must run AFTER cordova build completes so the changes survive into the next Xcode session where the user builds the Mac Catalyst target.
Two patches.
- Strip
-framework "GoogleAdsOnDeviceConversion"(and-weak_frameworkvariants) fromOTHER_LDFLAGSin bothPods-App.debug.xcconfigandPods-App.release.xcconfig. This removes the linker's search for the missing Catalyst slice. - Add
platformFilter = ios;to everyPBXTargetDependencyinPods/Pods.xcodeproj/project.pbxprojthat references theGoogleAdsOnDeviceConversiontarget. This prevents Xcode from trying to build/integrate the xcframework when the active destination is Mac Catalyst, while leaving iOS-device and iOS-simulator builds completely unaffected.
[FirebaseAnalytics][I-ACS023279] Conversion service disabled) and continues to function for event logging.Callers. Invoked unconditionally from bin/ios-build-release.sh and bin/ios-build-debug.sh in iiziRunDevel (which always builds Mac Catalyst). Invoked from CommonBuilder for iiziRun Custom / ICU / BIG ACE only when RuntimeBuilderProps.build_mac_catalyst is true.
- Author:
- Christopher Mindus
Constructor Summary
ConstructorsMethod Summary
Modifier and TypeMethodDescriptionstatic voidApplies the two Mac Catalyst linker patches described in the class JavaDoc.static voidCommand-line entry point for the iiziRun Developer iOS build scripts.
Constructor Details
IOSMacCatalystPatches
public IOSMacCatalystPatches()
Method Details
main
Command-line entry point for the iiziRun Developer iOS build scripts.Exit codes:
0= success,1= failure (stack trace on stderr).The current working directory must be the Cordova project root (the directory containing
platforms/ios/). Arguments are currently ignored.applyMacCatalystPatches
public static void applyMacCatalystPatches(File appDir, Consumer<String> info, Consumer<String> warn) throws IOException Applies the two Mac Catalyst linker patches described in the class JavaDoc. Both patches are idempotent -- marker comments andplatformFilterattribute presence mean re-running this method against already-patched artifacts is a no-op.Missing files/directories (e.g.
platforms/ios/Pods/absent becausepod installnever ran) produce WARN-level log lines but do NOT throw. This keeps the method safe to invoke even when an earlier build step failed.- Parameters:
appDir- The Cordova app directory (project root).info- Logs an informational message.warn- Logs a warning message.- Throws:
IOException- For I/O errors writing the modified files.