Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase Auth causing Flutter app to crash

I've just started a new Flutter app, so nothing has really bee done yet. I added firebase_core: to my pubspec.yaml file, no errors and the app starts up fine. when I add firebase_auth: it gives me this error:

Launching lib/main.dart on iPhone 11 Pro Max in debug mode...
Xcode build done.                                           21.9s
    path: satisfied (Path is satisfied), interface: en0
Configuring the default Firebase app...
*** First throw call stack:
(
    0   CoreFoundation                      0x00007fff23e3dcce __exceptionPreprocess + 350
    1   libobjc.A.dylib                     0x00007fff50b3b9b2 objc_exception_throw + 48
    2   CoreFoundation                      0x00007fff23e3db0c +[NSException raise:format:] + 188
    3   Runner                              0x0000000109e60912 +[FIRApp configure] + 130
    4   Runner                              0x0000000109f2fcd9 -[FLTFirebaseAuthPlugin init] + 217
    5   Runner                              0x0000000109f2fa9b +[FLTFirebaseAuthPlugin registerWithRegistrar:] + 171
    6   Runner                              0x0000000109dfbc13 +[GeneratedPluginRegistrant registerWithRegistry:] + 115
    7   Runner                            <…>
Exited

I've gotten it to this point and having a number of other issues with this package. What is happening?

like image 980
Garrett Avatar asked Jun 04 '26 09:06

Garrett


1 Answers

I think you forgot the last (7) Step here: https://pub.dev/packages/google_sign_in#ios-integration

You have to add the CFBundleTypeRoles in Info.plist for every signin method. This example here is for Google Sign In.

<!-- Put me in the [my_project]/ios/Runner/Info.plist file -->
<!-- Google Sign-in Section -->
<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleTypeRole</key>
        <string>Editor</string>
        <key>CFBundleURLSchemes</key>
        <array>
            <!-- TODO Replace this value: -->
            <!-- Copied from GoogleService-Info.plist key REVERSED_CLIENT_ID -->
            <string>com.googleusercontent.apps.861823949799-vc35cprkp249096uujjn0vvnmcvjppkn</string>
        </array>
    </dict>
</array>
<!-- End of the Google Sign-in Section -->

Change the REVERSED_CLIENT_ID with that one from your GoogleService-Info.plist

I home this helps you. I had the same error and this was the fix.

like image 81
Jakob Kühne Avatar answered Jun 06 '26 07:06

Jakob Kühne