-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
[🐛] @react-native-firebase/firestore fails to build on Xcode 16 - BoringSSL-GRPC issue unsupported option '-G' #8020
Comments
Same here. |
Same for me. Apparently this issue was fixed in BoringSSL 0.36. |
This fix indeed seems to work. Adding this code piece to the podfile and then reinstalling the pods is a temporary fix. |
@itsjustjo96 Yes, that fix works. However, when using Expo Prebuild i.e CNG (Continuous Native Generation ), the podfile gets overwritten every time. |
Thank you for the workaround, @itsjustjo96 🙏 . Unfortunately, I'll be away for a week. If there is someone who is able to raise a PR in the meanwhile, I can take a look when I get back. Otherwise, I can get a fix up next week 👍 |
Upstream firebase-ios-sdk specifies a version range for the transitive gRPC dependency with the problem: Here's the upstream issue firebase/firebase-ios-sdk#13115 When I do a fresh install using firebase-ios-sdk 11.2.0 it works to bring in a version of gRPC with the fix, that is a gRPC with version >= 1.65.2: run
gRPC and Firestore compile fine for me So I do not believe this is an issue. You may need to remove your Podfile.lock and reinstall Pods to get the updated transitive dependency? |
Note that if you are using the pre-compiled / binary Firebase from firestore-ios-sdk-frameworks they do not appear to have the fix but that is not a bug in react-native-firebase, it should be logged tracked over there. Appears they are still on gRPC 1.65.1 which does not have the fix: https://github.com/search?q=repo%3Ainvertase%2Ffirestore-ios-sdk-frameworks+gRPC&type=code A workaround would be to deintegrate the pre-compiled version and build firestore from current source with current transitive deps, and if compile speed is an issue you might try ccache |
@mikehardy If I spawn up a new Expo project and add |
@alfjesus I don't use Expo so I cannot comment. (I have local changes in that one to do the test, but it shows what I'm doing - init of bare react-native project, scripted integration of react-native-firebase, build test) |
@mikehardy Okay I see. It's just that my Expo project was building fine on Xcode 15.4 and as soon I upgraded to Xcode 16 this build issue started to happen. |
I believe I see the problem - just noticed that react-native-firebase hasn't adopted firebase-ios-sdk v11+ yet It is only in firebase-ios-sdk v11+ that the gRPC version was updated, you can see the commit that did the bump and expand the tag list to see it is only SDK v11+ tags: firebase/firebase-ios-sdk@89a0ab3 My build rig specifically overrides firebase-ios-sdk in order to compile test with newer versions in order to find problems before users do, but that means it doesn't always see problems with interop in older versions Unfortunately if you use firebase-ios-sdk v11+ via an override, you'll have a new problem which is that the crashlytics init provider API signature upstream changed and is not compatible across the firebase-ios-sdk v10 / v11 boundary react-native-firebase/packages/crashlytics/ios/RNFBCrashlytics/RNFBCrashlyticsInitProvider.m Line 137 in 480947e
(with a local patch that implements #8025, and a patch that implements #8021 which I just posted, firebase-ios-sdk v11.2.0 appears to work fine with gRPC and crashlytics in build testing at least) |
@mikehardy Nice to hear that you have nailed down the root cause of the issue. Hopefully react-native-firebase can be adotped soon to use firebase-ios-sdk v11+. I believe that the number of users impacted by this issue will increase by every day that passed by when people upgrade to Xcode 16, unaware of this issue. Rollback is also not so easy since after upgrading to Xcode 16 on MacOS Sequoia, you can't roll back to Xcode 15.4. |
Figured out a temporary patch to adopt in firebase-ios-sdk v11+. Builds successfully after patching. Attaching the patch files |
If you need crashlytics and firebase-ios-sdk v11+ you'll also want this: diff --git a/node_modules/@react-native-firebase/crashlytics/ios/RNFBCrashlytics/RNFBCrashlyticsInitProvider.m b/node_modules/@react-native-firebase/crashlytics/ios/RNFBCrashlytics/RNFBCrashlyticsInitProvider.m
index b815df9..4e4961d 100644
--- a/node_modules/@react-native-firebase/crashlytics/ios/RNFBCrashlytics/RNFBCrashlyticsInitProvider.m
+++ b/node_modules/@react-native-firebase/crashlytics/ios/RNFBCrashlytics/RNFBCrashlyticsInitProvider.m
@@ -134,7 +134,6 @@ NSString *const KEY_CRASHLYTICS_JAVASCRIPT_EXCEPTION_HANDLER_CHAINING_ENABLED =
FIRComponent *crashlyticsInitProvider =
[FIRComponent componentWithProtocol:@protocol(RNFBCrashlyticsInitProviderProtocol)
instantiationTiming:FIRInstantiationTimingEagerInDefaultApp
- dependencies:@[] // note this will go away in firebase-ios-sdk v11+
creationBlock:creationBlock];
return @[ crashlyticsInitProvider ]; (I have it as patches/@react-native-firebase+crashlytics+20.5.0.patch) --> https://github.com/mikehardy/rnfbdemo/blob/main/patches/%40react-native-firebase%2Bcrashlytics%2B20.5.0.patch |
Thank you! 🙏 I just want to confirm that with these 3 patches our Expo-project now builds again. 🎉 |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
Hey everyone! 👋 +1s, reports that it is also affecting you: that does not help The workaround right now is to patch react-native-firebase with the above patches:
And then we have to wait for an official release If you subscribe to this issue using the button on the right of the github web UI you will be notified when it is closed so you know there is new information Until then, we all have to use the patches or wait for a release. |
For Expo project this solution works for me:
|
@terrafant Even though your fix works, I don't understand why this option is preferable compared to patches? I mean once a new version of react-native-firebase is out, you will need to modify app.config.js again to remove the fix. A patch on the other hand is only bound and applied to a specific version, hence no code change is necessary when a new release is out. |
@alfjesus because this way I don't have to reapply patches again if I need to redo |
https://github.com/ds300/patch-package to the rescue! This is want I use. Applies patches automatically every time you do |
It may be that adopting new versions requires some sort of coordination / certification process for users such that even a release of react-native-firebase does not really help them quickly as someone may not be able to adopt it, and patches may not be allowed for certification reasons too 🤷 . So I appreciate the Expo plugin workaround from @terrafant even if I also personally use + love the You never know which workaround people will need. I believe the fixes required to adopt firebase-ios-sdk v11+ are in process though and there will be a release soon. Until then, patch it, do a plugin, whichever works but hopefully everyone is able to continue working despite the yearly disruption that is the Xcode release day :-) |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as duplicate.
This comment was marked as duplicate.
I am using Expo so I modify the fix script like this: # withBoringSSLFix.js
const { withDangerousMod } = require('@expo/config-plugins');
const fs = require('fs');
const path = require('path');
const withBoringSSLFix = (config) => {
return withDangerousMod(config, [
'ios',
(config) => {
const podfilePath = path.join(config.modRequest.platformProjectRoot, 'Podfile');
let podfileContents = fs.readFileSync(podfilePath, 'utf-8');
// Fix for the Podfile
const fix = `
# Fix BoringSSL-GRPC issue unsupported option '-G'
# Reason: BoringSSL-GRPC doesn't compatible with Xcode 16
# https://github.com/invertase/react-native-firebase/issues/8020?fbclid=IwY2xjawFc9KxleHRuA2FlbQIxMQABHenJMPNnLPuWcojthZjTcuIvoSKes2ATG69IuneRy2bUjAH3J2nYr-5nlQ_aem_XnJhQUj0eNzBy5xl6kjfmw#issuecomment-2359198907
installer.pods_project.targets.each do |target|
if target.name == 'BoringSSL-GRPC'
target.source_build_phase.files.each do |file|
if file.settings && file.settings['COMPILER_FLAGS']
flags = file.settings['COMPILER_FLAGS'].split
flags.reject! { |flag| flag == '-GCC_WARN_INHIBIT_ALL_WARNINGS' }
file.settings['COMPILER_FLAGS'] = flags.join(' ')
end
end
end
end
`;
if (!podfileContents.includes("if target.name == 'BoringSSL-GRPC'")) {
const findString = 'post_install do |installer|';
const postInstallIndex = podfileContents.indexOf(findString);
if (postInstallIndex !== -1) {
podfileContents =
podfileContents.slice(0, postInstallIndex + findString.length) +
fix +
podfileContents.slice(postInstallIndex + findString.length);
}
fs.writeFileSync(podfilePath, podfileContents);
}
return config;
},
]);
};
module.exports = withBoringSSLFix; |
Above works great |
Released this morning, current RNFB should work with current Xcode once again |
Great work @mikehardy and anyone else involved in the fix 👏 |
That's amazing news! @mikehardy Well done |
@mikehardy After updating RNFB libraries to |
@tboba not enough information to say, but this could happen if you are overriding the firebase iOS sdk in podfile. My build demonstrator at GitHub mikehardy/rnfbdemo has no problem showing successful build now |
@mikehardy Yup! Changing manually version of |
@Emmanueldmlr I believe all the fixes are documented in this issue. If you are using current react-native-firebase and remove any firebase-ios-sdk version pins you've placed in Podfile, it will build. If it does not, you have a local project problem Conclusive proof it works, a start-from-scratch fully automated build demo: https://github.com/mikehardy/rnfbdemo/blob/main/make-demo.sh |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Can you please provide exact steps and your version of Expo & Xcode |
@hamzalakrati it is closed because it is fixed. We get 534,000+ downloads a week and this was closed 3 weeks ago So it's fixed but your project has a problem. Check your Podfile.lock and examing the grpc dependency to make sure it is the right one as mentioned in this comment: Maybe remove your Podfile.lock and pod install again. Make sure you have no firebase-ios-sdk version pins, make sure react-native-firebase is all the same version and all the current version. |
@mikehardy I'm on Xcode 16.1 with target 18.1 and get this error for both 21.3.0 and 21.4.0, our CI machine which uses Xcode 16.0 seems to build without a problem. Are you sure that there is no new incompability? |
@stefan-schweiger In response to your query I just ran my build repro / demonstrator make-demo.sh right now to confirm everything is building with current tools It all works fine, from scratch, rnfb 21.4.0, Xcode 16.1 target iOS 18.1 simulator debug and release
Check your Podfile.lock as mentioned #8020 (comment) There are no incompatibilities I'm aware of |
Issue
Getting the following "unsupported option -G" build error when trying to build with Expo 51 and Xcode 16.
I'm guessing that the dependency for pod BoringSSL-GRPC needs an update.
Project Files
Javascript
Click To Expand
package.json
:# N/A
firebase.json
for react-native-firebase v6:# N/A
iOS
Click To Expand
ios/Podfile
:# N/A
AppDelegate.m
:// N/A
Android
Click To Expand
Have you converted to AndroidX?
android/gradle.settings
jetifier=true
for Android compatibility?jetifier
for react-native compatibility?android/build.gradle
:// N/A
android/app/build.gradle
:// N/A
android/settings.gradle
:// N/A
MainApplication.java
:// N/A
AndroidManifest.xml
:<!-- N/A -->
Environment
Click To Expand
react-native info
output:react-native-firebase
version you're using that has this issue:20.5.0
Firebase
module(s) you're using that has the issue:firestore
TypeScript
?Y
&5.3.3
React Native Firebase
andInvertase
on Twitter for updates on the library.The text was updated successfully, but these errors were encountered: