Unable to run/build in iOS when using along with `cloud_firestore`

Bug Report

I am facing an issue while using your package along with cloud_firestore. This is working just fine in Android, but facing the issue in iOS.

In iOS, single_factor_auth_flutter depends on OpenSSL whereas cloud_firestore depends on BoringSSL (BoringSSL is a fork of OpenSSL that is designed to meet Google’s needs).

When using both the packages simultaneously, BoringSSL is tampering with OpenSSL files, which is manipulating it’s header files.

As a result we are getting the following error while running for iOS:

Failed to build iOS app
Lexical or Preprocessor Issue (Xcode): 'openssl_grpc/base.h' file not found
/Users/cumulations/Desktop/flutter_apps/w3a_spm_issue_demo/ios/Pods/BoringSSL-GRPC/src/include/openssl/aes.h:51:9

Steps to reproduce

Try the following to run for iOS:

flutter create demo
cd demo
flutter pub get
flutter pub add cloud_firestore single_factor_auth_flutter
flutter run

Expected behavior

It should build without any error.

Sample project

Here is a minimal reproducible example. In this, I have just added cloud_firestore and single_factor_auth_flutter and trying to build for iOS.


Additional context

Flutter doctor

Click To Expand
[!] Flutter (Channel stable, 3.13.9, on macOS 13.3.1 22E261 darwin-arm64, locale en-IN)
    ! Warning: `dart` on your path resolves to /opt/homebrew/Cellar/dart/3.1.3/libexec/bin/dart, which is not inside your current Flutter SDK checkout at /Users/cumulations/fvm/versions/3.13.9. Consider adding /Users/cumulations/fvm/versions/3.13.9/bin to the front of your path.
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
[✓] Android Studio (version 2022.3)
[✓] VS Code (version 1.85.0)
Unknown architecture undefined_arch, defaulting to arm64
[✓] Connected device (1 available)
[✓] Network resources

Flutter dependencies

Click To Expand
Dart SDK 3.1.5
Flutter SDK 3.13.9
w3a_spm_issue_demo 1.0.0+1

dependencies:
- cloud_firestore 4.13.6 [cloud_firestore_platform_interface cloud_firestore_web collection firebase_core firebase_core_platform_interface flutter meta]
- cupertino_icons 1.0.6
- flutter 0.0.0 [characters collection material_color_utilities meta vector_math web sky_engine]
- single_factor_auth_flutter 1.0.0 [flutter plugin_platform_interface]

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

transitive dependencies:
- _flutterfire_internals 1.3.16 [collection firebase_core firebase_core_platform_interface flutter meta]
- async 2.11.0 [collection meta]
- boolean_selector 2.1.1 [source_span string_scanner]
- characters 1.3.0
- clock 1.1.1
- cloud_firestore_platform_interface 6.0.10 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface]
- cloud_firestore_web 3.8.10 [_flutterfire_internals cloud_firestore_platform_interface collection firebase_core firebase_core_web flutter flutter_web_plugins js]
- collection 1.17.2
- fake_async 1.3.1 [clock collection]
- firebase_core 2.24.2 [firebase_core_platform_interface firebase_core_web flutter meta]
- firebase_core_platform_interface 5.0.0 [collection flutter flutter_test meta plugin_platform_interface]
- firebase_core_web 2.10.0 [firebase_core_platform_interface flutter flutter_web_plugins js meta]
- flutter_web_plugins 0.0.0 [flutter characters collection material_color_utilities meta vector_math web]
- js 0.6.7 [meta]
- lints 2.1.1
- matcher 0.12.16 [async meta stack_trace term_glyph test_api]
- material_color_utilities 0.5.0 [collection]
- meta 1.9.1
- path 1.8.3
- plugin_platform_interface 2.1.7 [meta]
- sky_engine 0.0.99
- source_span 1.10.0 [collection path term_glyph]
- stack_trace 1.11.0 [path]
- stream_channel 2.1.1 [async]
- string_scanner 1.2.0 [source_span]
- term_glyph 1.2.1
- test_api 0.6.0 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph]
- vector_math 2.1.4
- web 0.1.4-beta

@samyak.b Thanks for reaching out.

Your issue has been forwarded to our Dev team and we will get back with further updates.

@samyak.b We are already using openssl for network security and used by all commonly. But BoringSSL as mentioned is designed to meet google needs. Since its fork of openSSL, atleast google needs to make it compatible with original version of openssl. Don’t think its from sfa-flutter issue since we are not using modified version of openssl.

Hey @gaurav,

I also reached out to cloud_firestore dev (Github issue), and this is what they told:

I don’t think this is a cloud_firestore issue, but could be in the mentioned plugin you are using.
The plugin seems to be importing an ambiguous Base64.h and picking up the one from the BoringSSL install.

Could you please confirm if what they told about your package is true or not?

@samyak.b We are using openSSL for cryptographic operations not the BoringSSL. We are not using BoringSSL inside single-factor-auth-flutter, so how can it be using Base64.h from BoringSSL when even not used inside package.

Because I am not familiar with Swift development, I am unable to answer your question.
The issue is that it is working absolutely fine in Android, and unable to build in iOS. Could you please help me to set up the project while using both mentioned packages simultaneously?

This is the issue assciated with cloud_firestore sdk in iOS. Attaching some post relates to it:

Thank you so much, I’ll take a look in the mentioned forums.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.