-
Notifications
You must be signed in to change notification settings - Fork 4.1k
[firebase_app_check] FirebaseAuthException 'internal-error' on iOS with Google Sign-In Despite Perfect Configuration
#17691
-
When attempting to use Google Sign-In on a physical iOS device (both debug and release builds), the FirebaseAuth.instance.signInWithCredential call fails with a FirebaseAuthException whose code is internal-error. This occurs even though Firebase App Check appears to be perfectly configured on both the client and server. The error suggests a server-side failure during App Check token validation.
Steps to Reproduce
- Run the app on a physical iOS device (fails on both debug and release builds).
- Tap the "Sign In with Google" button.
- The native Google Sign-In prompt appears and is completed successfully.
- The
FirebaseAuth.instance.signInWithCredentialcall is made.
Expected behavior
The user should be successfully signed into Firebase.
Actual behavior
The signInWithCredential method throws a FirebaseAuthException with the code internal-error.
Exhaustive Troubleshooting Steps Taken
We have performed an exhaustive series of diagnostic steps that rule out all common configuration errors. The issue is not a user configuration error.
-
Client-Side Configuration (iOS):
- Verified Bundle ID and Team ID match exactly between Xcode and the Firebase Console.
- Confirmed the
App Attestcapability is enabled in Xcode. - Verified the
Runner.entitlementsfile contains<key>com.apple.developer.devicecheck.appattest-environment</key><string>production</string>. - Verified the
GoogleService-Info.plistis up-to-date and is a member of the mainRunnerbuild target. - Confirmed
AppDelegate.swiftdoes not contain a conflicting manualFirebaseApp.configure()call.
-
Server-Side Configuration:
- Confirmed the "Play Integrity API" (for Android) is enabled in Google Cloud.
- Confirmed the "Firebase App Check API" is enabled in Google Cloud.
-
Build Environment & Dependencies:
- Updated all
firebase_*andgoogle_sign_inpackages to the latest stable versions. - Performed a full "deep clean" (
flutter clean, deleting app from device, removingPodsandPodfile.lock, and runningpod install --repo-update).
- Updated all
-
Ultimate Isolation Test:
- The error still occurs when using a
GoogleService-Info.plistfrom a brand new, clean Firebase project. This proves the issue is not in the Firebase project's backend configuration but is local to the app code/dependencies.
- The error still occurs when using a
This appears to be a deep incompatibility or bug within the FlutterFire SDKs.
Beta Was this translation helpful? Give feedback.