I’m developing a Capacitor game and using the @capacitor-firebase/authentication plugin. It works perfectly on Android, but on iOS, the app hangs at the loading screen.
In the Xcode logs, I can see my web app’s JavaScript logs (console.log) executing correctly, including my log for “[BOOT] Firebase inicializado OK”.
However, immediately after the app loads, I get a fatal native error:
⚡️ Loading app at capacitor://localhost...
[ FirebaseAuthentication ] <CapacitorFirebaseAuthentication.RuntimeError: 0x6000002742c0>
...
(My JS logs appear much later)
...
⚡️ [log] - [BOOT] Firebase inicializado OK
⚡️ WebView loaded
The app freezes because the native authentication plugin crashes, even though the web part of Firebase initializes.
What I Have Tried (Checklist)
I have followed every troubleshooting guide, and my configuration appears to be 100% correct:
-
Keychain Sharing: The “Keychain Sharing” capability is enabled in “Signing & Capabilities” for my App target. *
-
GoogleService-Info.plist:-
The file is correctly placed in
ios/App/App/. -
The “Target Membership” is checked for the “App” target.
-
-
Bundle ID Match:
-
My
appIdincapacitor.config.json -
My
Bundle Identifierin Xcode (“Signing & Capabilities”) -
My
BUNDLE_IDinside theGoogleService-Info.plistfile -
…all match exactly.
-
-
Clean Build: I have performed a “nuclear clean” multiple times:
-
rm -rf ios/App/Pods -
rm -rf ios/App/Podfile.lock -
pod cache clean --all -
pod install --repo-update -
Xcode > Product > Clean Build Folder
-
Deleted the app from the simulator.
-
-
Diagnostic Test: I added a check in
AppDelegate.swiftright afterFirebaseApp.configure():Swift
guard let _ = FirebaseApp.app() else { fatalError("--> FATAL ERROR: FirebaseApp.app() is null.") }The app does not crash with this error. This proves that
FirebaseApp.configure()is succeeding, and the.plistfile is being read correctly.
The Question
Given that FirebaseApp.configure() is successful, why is the FirebaseAuthentication plugin still throwing a RuntimeError immediately on launch?
It seems to be a Keychain Sharing problem, but my configuration looks correct. Is there a project cache, build setting, or provisioning profile issue that could cause Xcode to show the capability but not actually apply it in the build, leading to this RuntimeError?