Skip to content

[firebase_auth]: Issue with PhoneAuthProvider #17284

Closed
@itisparas

Description

@itisparas

Is there an existing issue for this?

  • I have searched the existing issues.

Which plugins are affected?

Auth

Which platforms are affected?

iOS

Description

I had an existing application built using Xcode 15 and Firebase Auth version 4.

Recently, with an update to the MacOS, Xcode 15 is no more compatible with MacOS Sequoia, so I had to upgrade Xcode to v16.

With Xcode 16 and Firebase Auth v4 I was getting an error related to cloud_firebase dependency BoringSSL-GRPC.

Could not build the precompiled application for the device.
Error (Xcode): unsupported option '-G' for target 'arm64-apple-ios10.0'

The min version of iOS I am targeting was 13.0

Now, the updated dependencies of the project are:

firebase_core: ^3.13.0
cloud_firestore: ^5.6.6
firebase_auth: ^5.5.2

But with these dependencies, the same Firebase Authentication that was working with v4, I am getting error:

FirebaseAuth/PhoneAuthProvider.swift:111: Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value

Reproducing the issue

  1. Install firebase_core, cloud_firestore and firebase_auth latest version dependencies to the application.
  2. Implement Phone number authentication as per the Firebase official documentation for Flutter.
  3. Run the application and try to trigger FirebaseAuth.instance.verifyPhoneNumber() with the phone number from the user input.

As soon as verifyPhoneNumber() is triggered the application will crash with the error message:

FirebaseAuth/PhoneAuthProvider.swift:111: Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value

Firebase Core version

3.13.0

Flutter Version

3.29.2

Relevant Log Output

Flutter dependencies

Expand Flutter dependencies snippet
Dart SDK 3.7.2
Flutter SDK 3.29.2
myapp 1.0.0+1

dependencies:
- cloud_firestore 5.6.6 [cloud_firestore_platform_interface cloud_firestore_web collection firebase_core firebase_core_platform_interface flutter meta]
- cupertino_icons 1.0.8
- firebase_auth 5.5.2 [firebase_auth_platform_interface firebase_auth_web firebase_core firebase_core_platform_interface flutter meta]
- firebase_core 3.13.0 [firebase_core_platform_interface firebase_core_web flutter meta]
- flutter 0.0.0 [characters collection material_color_utilities meta vector_math sky_engine]

dev dependencies:
- flutter_lints 5.0.0 [lints]
- flutter_test 0.0.0 [flutter test_api matcher path fake_async clock stack_trace vector_math leak_tracker_flutter_testing async boolean_selector characters collection leak_tracker leak_tracker_testing material_color_utilities meta source_span stream_channel string_scanner term_glyph vm_service]

transitive dependencies:
- _flutterfire_internals 1.3.54 [collection firebase_core firebase_core_platform_interface flutter meta]
- async 2.12.0 [collection meta]
- boolean_selector 2.1.2 [source_span string_scanner]
- characters 1.4.0
- clock 1.1.2
- cloud_firestore_platform_interface 6.6.6 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface]
- cloud_firestore_web 4.4.6 [_flutterfire_internals cloud_firestore_platform_interface collection firebase_core firebase_core_web flutter flutter_web_plugins]
- collection 1.19.1
- fake_async 1.3.2 [clock collection]
- firebase_auth_platform_interface 7.6.2 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface]
- firebase_auth_web 5.14.2 [firebase_auth_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins http_parser meta web]
- firebase_core_platform_interface 5.4.0 [collection flutter flutter_test meta plugin_platform_interface]
- firebase_core_web 2.22.0 [firebase_core_platform_interface flutter flutter_web_plugins meta web]
- flutter_web_plugins 0.0.0 [flutter characters collection material_color_utilities meta vector_math]
- http_parser 4.1.2 [collection source_span string_scanner typed_data]
- leak_tracker 10.0.8 [clock collection meta path vm_service]
- leak_tracker_flutter_testing 3.0.9 [flutter leak_tracker leak_tracker_testing matcher meta]
- leak_tracker_testing 3.0.1 [leak_tracker matcher meta]
- lints 5.1.1
- matcher 0.12.17 [async meta stack_trace term_glyph test_api]
- material_color_utilities 0.11.1 [collection]
- meta 1.16.0
- path 1.9.1
- plugin_platform_interface 2.1.8 [meta]
- sky_engine 0.0.0
- source_span 1.10.1 [collection path term_glyph]
- stack_trace 1.12.1 [path]
- stream_channel 2.1.4 [async]
- string_scanner 1.4.1 [source_span]
- term_glyph 1.2.2
- test_api 0.7.4 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph]
- typed_data 1.4.0 [collection]
- vector_math 2.1.4
- vm_service 14.3.1
- web 1.1.1

Additional context and comments

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    blocked: customer-responseWaiting for customer response, e.g. more information was requested.platform: iosIssues / PRs which are specifically for iOS.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