Can’t compile React Native iOS app to run on physical device, issue with React Native Firebase

For some reason since recently, I cannot run my React Native app on a physical device from Xcode or even from the command line. I’m getting the following error:

duplicate symbol '_md5_block_data_order' in:
    /XXX/Library/Developer/Xcode/DerivedData/XXXX-bdrylwsxpcqgzvgkcljteyttcdmr/Build/Products/Debug-iphoneos/BoringSSL-GRPC/libBoringSSL-GRPC.a(md5.o)
    /XXX/project/ios/Pods/OpenSSL-Universal/ios/lib/libcrypto.a(md5_dgst.o)
ld: 1 duplicate symbol for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

However it works fine from a simulator. And I can upload the app to AppStoreConnect without any issue.

From what I understand it looks like the same symbol exists in 2 libraries. Not sure why, most likely one of the mobile app dependencies.

In the list of Pods installed I have both BoringSSL-GRPC (0.0.3) and OpenSSL-Universal (1.0.2.19)

BoringSSL is used by Firebase and OpenSSL is used by Flipper.

This is the list of third party dependencies I use:

  pod 'Firebase/Core', '~> 6.3.0'

  pod 'Firebase/Messaging', '~> 6.3.0'

  pod 'Firebase/Firestore', '~> 6.3.0'

  pod 'Firebase/Auth', '~> 6.3.0'

  pod 'TrustKit'

  pod 'Stripe', '16.0.0'

  pod 'Amplitude-iOS', '~> 4.5'

  pod 'Intercom', '~> 5.5.1'

  flipper_pods()

When I remove Firebase all together, it works fine and I can run my app on the device. But I need Firebase…

Any idea how to resolve this?

Thanks!

Source: Ios