Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[firebase_auth] Firestore crash on user authentication on iOS #12536

Open
1 task done
GustavoDuregger opened this issue Mar 26, 2024 · 3 comments
Open
1 task done

[firebase_auth] Firestore crash on user authentication on iOS #12536

GustavoDuregger opened this issue Mar 26, 2024 · 3 comments
Labels
blocked: firebase-sdk platform: ios Issues / PRs which are specifically for iOS. plugin: auth type: bug Something isn't working

Comments

@GustavoDuregger
Copy link

Is there an existing issue for this?

  • I have searched the existing issues.

Which plugins are affected?

Core, Auth, Other

Which platforms are affected?

iOS

Description

The application crashes after authentication. In the case where the user is already logged in, the failure occurs immediately after opening the app.

Crash logs mention problems with GRPC/SSL

This is happening in an installed Testflight application. I can't reproduce it in a simulator locally.

Reproducing the issue

Add firebase_auth: ^4.6.0; firebase_core: ^2.24.2; firebase_storage: ^11.2.0;
Run app in testflight
Authenticate the user via your preferred Google Sign In method
See that it crashes
Open the app again, see that it immediately crashes.

Firebase Core version

2.25.5

Flutter Version

3.19.1

Relevant Log Output

Crashed: com.google.firebase.firestore
0  libsystem_kernel.dylib         0x9fbc __pthread_kill + 8
1  libsystem_pthread.dylib        0x5680 pthread_kill + 268
2  libsystem_c.dylib              0x75b90 abort + 180
3  libsystem_c.dylib              0x74e80 __assert_rtn + 282
4  openssl_grpc                   0xcab24 GRPC_ec_felem_neg.cold.1 + 38
5  openssl_grpc                   0x434a4 GRPC_ec_felem_neg + 146
6  openssl_grpc                   0x304d0 ec_group_set_a_minus3 + 56
7  openssl_grpc                   0x2e8ec GRPC_EC_group_p256_init + 264
8  libsystem_pthread.dylib        0x33d4 <redacted> + 76
9  libsystem_platform.dylib       0x1eb4 <redacted> + 32
10 libsystem_pthread.dylib        0x37a8 pthread_once + 100
11 openssl_grpc                   0xa70bc GRPC_CRYPTO_once + 12
12 openssl_grpc                   0x2f024 GRPC_EC_GROUP_new_by_curve_name + 168
13 openssl_grpc                   0x318b0 GRPC_EC_KEY_new_by_curve_name + 40
14 grpc                           0x272238 populate_ssl_context(ssl_ctx_st*, tsi_ssl_pem_key_cert_pair const*, char const*) + 408
15 grpc                           0x271a38 tsi_create_ssl_client_handshaker_factory_with_options(tsi_ssl_client_handshaker_options const*, tsi_ssl_client_handshaker_factory**) + 348
16 grpc                           0x26d3f4 grpc_ssl_credentials::InitializeClientHandshakerFactory(grpc_ssl_config const*, char const*, tsi_ssl_root_certs_store const*, tsi_ssl_session_cache*, tsi_ssl_client_handshaker_factory**) + 208
17 grpc                           0x26d23c grpc_ssl_credentials::grpc_ssl_credentials(char const*, grpc_ssl_pem_key_cert_pair*, grpc_ssl_verify_peer_options const*) + 172
18 grpc                           0x26d974 grpc_ssl_credentials_create + 84
19 grpcpp                         0x28a28 grpc::SslCredentials(grpc::SslCredentialsOptions const&) + 176
20 FirebaseFirestoreInternal      0x91f58 firebase::firestore::remote::(anonymous namespace)::CreateSslCredentials(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) + 60
21 FirebaseFirestoreInternal      0x91af8 firebase::firestore::remote::GrpcConnection::CreateChannel() const + 356
22 FirebaseFirestoreInternal      0x918a4 firebase::firestore::remote::GrpcConnection::EnsureActiveStub() + 128
23 FirebaseFirestoreInternal      0x91fe8 firebase::firestore::remote::GrpcConnection::CreateStream(absl::lts_20240116::string_view, firebase::firestore::credentials::AuthToken const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, firebase::firestore::remote::GrpcStreamObserver*) + 60
24 FirebaseFirestoreInternal      0x138408 firebase::firestore::remote::Stream::ResumeStartWithCredentials(firebase::firestore::util::StatusOr<firebase::firestore::credentials::AuthToken> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) + 132
25 FirebaseFirestoreInternal      0x139ac8 std::__1::__function::__func<firebase::firestore::remote::Stream::RequestCredentials()::$_0::operator()(absl::lts_20240116::optional<firebase::firestore::util::StatusOr<firebase::firestore::credentials::AuthToken>> const&, absl::lts_20240116::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>> const&) const::'lambda'(), std::__1::allocator<firebase::firestore::remote::Stream::RequestCredentials()::$_0::operator()(absl::lts_20240116::optional<firebase::firestore::util::StatusOr<firebase::firestore::credentials::AuthToken>> const&, absl::lts_20240116::optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>> const&) const::'lambda'()>, void ()>::operator()() + 72
26 FirebaseFirestoreInternal      0x86b0 firebase::firestore::util::AsyncQueue::ExecuteBlocking(std::__1::function<void ()> const&) + 68
27 FirebaseFirestoreInternal      0x14b634 firebase::firestore::util::Task::ExecuteAndRelease() + 184
28 libdispatch.dylib              0x4300 <redacted> + 20
29 libdispatch.dylib              0xb894 <redacted> + 748
30 libdispatch.dylib              0xc3c4 <redacted> + 380
31 libdispatch.dylib              0x17004 <redacted> + 288
32 libdispatch.dylib              0x16878 <redacted> + 404
33 libsystem_pthread.dylib        0x1964 _pthread_wqthread + 288
34 libsystem_pthread.dylib        0x1a04 start_wqthread + 8

Flutter dependencies

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

Additional context and comments

It may be related to the changes in 10.23.0 of the iOS SDK
https://firebase.google.com/support/release-notes/ios#10.23.0
firebase/firebase-ios-sdk#12606

@GustavoDuregger GustavoDuregger added Needs Attention This issue needs maintainer attention. type: bug Something isn't working labels Mar 26, 2024
@Whaleman0423
Copy link

Whaleman0423 commented Mar 26, 2024

Hi, your error message is exactly the same as mine. I use flutter for ios app.

A few days ago, my software department manager deployed the APP I developed and executed it according to the deployment process I wrote. Finally, this error occurred during the testflight test.

However, when I followed the deployment process, deployed and executed flutter build ipa on my other apple mac, and then ran the testflight test again, I found that there was no such error.

Therefore, I suspect that there may be a problem with the Xcode or cocoapods version that causes problems in building the ipa, or an exception occurs when the flutter package is installed into the ios package.

my cocoapods version:
1.15.2
XCode version:
Version 14.3.1 (14E300c)

my flutter package version:

  cached_network_image: ^3.3.1
  cloud_firestore: ^4.15.9
  file_picker: ^6.2.0
  firebase_analytics: ^10.8.10
  firebase_auth: ^4.17.9
  firebase_core: ^2.27.1
  firebase_storage: ^11.6.10
  firebase_ui_auth: ^1.13.1
  firebase_ui_oauth_google: ^1.3.1
  flutter_line_sdk: ^2.3.6
  flutter_udid: ^3.0.0
  google_mobile_ads: ^4.0.0
  http: ^1.2.1
  image: ^4.1.7
  infinite_scroll_pagination: ^4.0.0
  jwt_decoder: ^2.0.1
  logger: ^2.1.0
  path_provider: ^2.1.2
  pigeon: ^17.1.2
  shared_preferences: ^2.2.2
  uuid: ^4.3.3
  universal_html: ^2.2.4
  video_player: ^2.8.3

@TarekkMA TarekkMA added plugin: auth platform: ios Issues / PRs which are specifically for iOS. blocked: firebase-sdk labels Mar 27, 2024
@TarekkMA
Copy link
Contributor

Hi @GustavoDuregger, @Whaleman0423, this issue appears widespread among ReactNative users as well (see invertase/react-native-firebase#7695), indicating it might stem from the native library, potentially due to a migration to OpenSSL.

In the meantime, please consider upvoting firebase/firebase-ios-sdk#12606 and sharing your crash report there for visibility.

@russellwheatley russellwheatley removed the Needs Attention This issue needs maintainer attention. label Mar 27, 2024
@Whaleman0423
Copy link

Whaleman0423 commented Mar 27, 2024

change to pod 'BoringSSL-GRPC', '0.0.24'
reference: invertase/react-native-firebase#7695 (comment)

my Podfile

#  參考: https://stackoverflow.com/questions/64362285/flutter-on-ios-fatal-error-module-cloud-firestore-not-found
# 因為 podfile 無法獲取到 flutter 所需要的套件, 需要額外更新此份檔案後, 執行 pod install
 platform :ios, '13.0'

 ENV['COCOAPODS_DISABLE_STATS'] = 'true'

 project 'Runner', {

   'Debug' => :debug,
   'Profile' => :release,
   'Release' => :release,
 }

 def flutter_root
   generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
   unless File.exist?(generated_xcode_build_settings_path)
     raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
   end

   File.foreach(generated_xcode_build_settings_path) do |line|
     matches = line.match(/FLUTTER_ROOT\=(.*)/)
     return matches[1].strip if matches
   end
   raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
 end

 require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

 flutter_ios_podfile_setup

 target 'Runner' do
   use_frameworks!
   use_modular_headers!

   # 固定 BoringSSL-GRPC 版本
   pod 'BoringSSL-GRPC', '0.0.24'

   flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
 end

 post_install do |installer|
   installer.pods_project.targets.each do |target|
     flutter_additional_ios_build_settings(target)
   end
 end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked: firebase-sdk platform: ios Issues / PRs which are specifically for iOS. plugin: auth type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants