Skip to content

Bug Rapport for FlutterFire GitHub Issue #18499

Description

@lizenkotech

Is there an existing issue for this?

  • I have searched the existing issues.

Which plugins are affected?

Auth

Which platforms are affected?

macOS

Description

Volledig Bug Rapport voor FlutterFire GitHub Issue (Geüpdatet)


Title

macOS Firebase Auth Keychain Error: OSStatus error 13 (errSecNotAvailable) met Flutter 3.44.4 + Firebase Auth 6.5.6 + Xcode 26.6 + macOS 26.5.1

Description

Firebase Authentication op macOS geeft een keychain-error met OSStatus error 13 (errSecNotAvailable) ondanks correcte code signing, entitlements en Keychain Sharing capability.

Belangrijk: Een volledig nieuwe minimale Flutter app met alleen firebase_core en firebase_auth geeft exact dezelfde fout, wat suggereert dat dit een regressie is in de SDK/toolchain combinatie.

Steps to Reproduce

  1. Flutter 3.44.4, Xcode 26.6, macOS 26.5.1
  2. Nieuw Flutter project met firebase_core 4.12.1 en firebase_auth 6.5.6
  3. Correcte code signing met Apple Development certificaat (Team ID: WN59633PU4)
  4. Keychain Sharing capability toegevoegd via Xcode
  5. Entitlements geverifieerd met codesign -d --entitlements :-
  6. Probeer in te loggen met Firebase Auth
  7. Zie keychain-error met OSStatus error 13

Expected behavior

Firebase Auth moet kunnen inloggen en credentials opslaan in macOS Keychain zonder foutmeldingen.

Actual behavior

FirebaseAuthException met code: keychain-error en bericht: "An error occurred when accessing the keychain. The NSLocalizedFailureReasonErrorKey field in the NSError.userInfo dictionary will contain more information about the error encountered"

Native macOS logs tonen: OSStatus error 13 (errSecNotAvailable)

Which plugins are affected?

  • firebase_auth (6.5.6)
  • firebase_core (4.12.1)

Which platforms are affected?

  • macOS (desktop)
  • Getest op macOS 26.5.1 (25F80)
  • Niet getest op iOS, Android, web, Linux, Windows

Environment

  • Flutter version: 3.44.4 (stable, revision ad70ec4617, 2026-06-24)
  • Dart version: 3.12.2
  • firebase_core: 4.12.1
  • firebase_auth: 6.5.6
  • firebase_auth_platform_interface: 9.0.5
  • macOS version: 26.5.1 (25F80)
  • Xcode version: 26.6 (Build 17F113)
  • Development Team ID: WN59633PU4
  • Code signing: Apple Development (automatic signing)
  • Keychain Sharing: Enabled via Xcode
  • Bundle ID: com.apojo.community (hoofdproject), com.example.firebaseAuthTest (testproject)

Additional context

Geteste Oplossingen (zonder resultaat)

  • ✅ Keychain Sharing capability toegevoegd via Xcode
  • ✅ Entitlements geverifieerd met codesign
  • ✅ Apple Development signing geconfigureerd
  • ✅ Sandbox uitgeschakeld in Debug mode
  • ✅ Firebase configuratie geverifieerd (bundle ID, app ID)
  • ✅ Minimale test app gemaakt met alleen firebase_core en firebase_auth
  • ❌ Oudere Firebase versies geprobeerd (firebase_auth 4.2.1, firebase_core 2.4.0)
  • ❌ Keychain Sharing capability heeft geen effect

Entitlements (geverifieerd met codesign)

<key>com.apple.security.app-sandbox</key>
<false/>
<key>com.apple.security.network.client</key>
<true/>
<key>com.apple.security.keychain-access-groups</key>
<array>
    <string>WN59633PU4.com.apojo.community</string>
</array>
<key>com.apple.security.application-groups</key>
<array>
    <string>WN59633PU4.com.apojo.community</string>
</array>

Native Logs

2026-07-30 07:28:08.952 apojoCommunityApp[57293:11126110] The operation couldn't be completed. (OSStatus error 13.)

Workaround

await FirebaseAuth.instance.setPersistence(Persistence.none);

Dit werkt maar logt gebruikers uit bij app sluiting.

Reproducibility

Het probleem is reproduceerbaar in:

  • Hoofdproject (Apojo Community App)
  • Minimale test project (firebase_auth_test)
  • Zowel met als zonder Keychain Sharing capability
  • Zowel met als zonder sandbox

Dit suggereert een regressie in de combinatie van Flutter 3.44.x + Firebase Auth 6.5.x + Xcode 26.x + macOS 26.x.

Related Issues

Reproducing the issue

Steps to reproduce

  1. Create a new Flutter application.
  2. Add the latest firebase_core and firebase_auth packages.
  3. Configure Firebase using FlutterFire CLI.
  4. Enable macOS and configure code signing with an Apple Development Team.
  5. Enable the Keychain Sharing capability in Xcode.
  6. Initialize Firebase:
await Firebase.initializeApp(
  options: DefaultFirebaseOptions.currentPlatform,
);
  1. Call:
await FirebaseAuth.instance.signInWithEmailAndPassword(
  email: "your-test-email@example.com",
  password: "your-password",
);
  1. Run the app on macOS.

Result

The call fails with:

[firebase_auth/keychain-error]
An error occurred when accessing the keychain.

Native macOS log:

OSStatus error 13 (errSecNotAvailable)

The issue is reproducible in both my main project and a brand-new minimal Flutter project.

Firebase Core version

4.12.1

Flutter Version

Flutter 3.44.4 • channel stable Framework • revision ad70ec4617 Engine • revision a10d8ac38d Dart 3.12.2

Relevant Log Output

flutter: Attempting sign in with email: lizenko.official@gmail.com (attempt 1/3)

flutter: FirebaseAuthException
flutter: code: keychain-error
flutter: message: An error occurred when accessing the keychain. The NSLocalizedFailureReasonErrorKey field in the NSError.userInfo dictionary will contain more information about the error encountered
flutter: details: [firebase_auth/keychain-error] An error occurred when accessing the keychain. The NSLocalizedFailureReasonErrorKey field in the NSError.userInfo dictionary will contain more information about the error encountered

Native macOS log:

OSStatus error 13 (errSecNotAvailable)

Flutter dependencies

Expand Flutter dependencies snippet
Replace this line with the contents of your `flutter pub deps -- --style=compact`.

Additional context and comments

The issue occurs in:

  • my production application
  • a brand new Flutter application created only to reproduce the issue

I verified:

  • Apple Development code signing
  • Automatic signing enabled
  • Development Team configured
  • Keychain Sharing capability enabled
  • Firebase configured with FlutterFire CLI
  • Correct bundle identifier
  • Correct entitlements
  • Firebase initializes successfully

The error only occurs when calling:

FirebaseAuth.instance.signInWithEmailAndPassword(...)

The same error occurs in both projects on the same machine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    blocked: customer-responseWaiting for customer response, e.g. more information was requested.platform: macosIssues / PRs which are specifically for MacOS.plugin: authtype: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions