Skip to content

Fix iOS build compatibility with Xcode 16#251

Merged
rileychh merged 3 commits intomasterfrom
patch-ios
Feb 5, 2026
Merged

Fix iOS build compatibility with Xcode 16#251
rileychh merged 3 commits intomasterfrom
patch-ios

Conversation

@rileychh
Copy link
Member

@rileychh rileychh commented Feb 4, 2026

Summary

  • Add build script (scripts/ios_build.sh) that patches Flutter plugins for Xcode 16+ compatibility
  • Fix Firebase duplicate initialization error by guarding Firebase.initializeApp() in Dart code
  • Disable native Firebase auto-initialization via FirebaseAppDelegateProxyEnabled flag

Changes

  • scripts/ios_build.sh: New build script that patches firebase_crashlytics, firebase_messaging, firebase_auth, and flutter_inappwebview plugins in ~/.pub-cache to use modular @import syntax instead of non-modular #import <Firebase/Firebase.h>
  • ios/Runner/AppDelegate.swift: Comment out FirebaseApp.configure() to let Dart handle initialization
  • ios/Runner/Info.plist: Add FirebaseAppDelegateProxyEnabled = NO to prevent auto-initialization
  • lib/main.dart: Wrap Firebase.initializeApp() in try-catch to handle already-initialized case

Why

Xcode 16+ treats non-modular header includes as errors (-Werror=non-modular-include-in-framework-module). The older Firebase Flutter plugins (required due to Dart 2.x constraint) use the legacy #import <Firebase/Firebase.h> syntax which fails with this stricter enforcement.

Test plan

  • Build succeeds with ./scripts/ios_build.sh build
  • App launches and runs past splash screen on iOS Simulator

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses iOS build compatibility issues with Xcode 16 by patching Firebase Flutter plugins and adjusting Firebase initialization to prevent duplicate initialization errors.

Changes:

  • Adds a new build script that patches outdated Firebase and flutter_inappwebview plugins in pub-cache to use modular imports
  • Modifies Firebase initialization in Dart to handle already-initialized cases
  • Disables native Firebase auto-initialization to prevent conflicts

Reviewed changes

Copilot reviewed 4 out of 15 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
scripts/ios_build.sh New build script that patches Firebase plugins for Xcode 16+ compatibility using sed commands to replace non-modular imports
scripts/validate_dependencies.sh Utility script to run dependency validator
scripts/update_dependencies.sh Utility script to update project dependencies
scripts/release_build_ios.sh Release build script for iOS with formatting and analysis
scripts/release_build_aos.sh Release build script for Android with deferred components
scripts/generate_splash_screen.sh Utility script to generate splash screens
scripts/generate_i18n.sh Utility script to generate internationalization files
scripts/format.sh Code formatting utility script
scripts/build_runner.sh Build runner utility script
scripts/add_version_selection.sh Script for adding Dart version selection comments (null-safety migration)
lib/main.dart Wraps Firebase.initializeApp() in try-catch to handle duplicate initialization
ios/Runner/AppDelegate.swift Comments out native FirebaseApp.configure() to let Dart handle initialization
ios/Runner/Info.plist Adds FirebaseAppDelegateProxyEnabled=NO and reorders keys alphabetically
ios/Podfile Removes trailing whitespace for consistency
ios/Podfile.lock Updates CocoaPods dependencies to newer versions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

bradly0cjw
bradly0cjw previously approved these changes Feb 4, 2026
rileychh added a commit that referenced this pull request Feb 4, 2026
rileychh added a commit that referenced this pull request Feb 5, 2026
* ci: select Xcode 16 for iOS builds

* ci: download iOS platform for Xcode 16

* ci: use setup-xcode action for Xcode 16

* ci: select XCode 16.0

* ci: list simulators

Signed-off-by: bradly0cjw <[email protected]>

* ci: patch flutter_inappwebview for iOS builds

* ci: port iOS patches from #251 to CI

* ci: cache ios simulator

* ci: cache flutter

[skip ci]

* ci: always save iOS Simulator cache

* ci: more patches

* ci: tim cook you fat fuck

---------

Signed-off-by: bradly0cjw <[email protected]>
Co-authored-by: bradly0cjw <[email protected]>
@rileychh rileychh merged commit a76f9cd into master Feb 5, 2026
4 checks passed
@rileychh rileychh deleted the patch-ios branch February 5, 2026 00:32
@rileychh rileychh mentioned this pull request Feb 5, 2026
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments