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
@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.
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?