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

use @import Firebase; instead of #import <Firebase.h> #4069

Closed
wants to merge 2 commits into from

Conversation

Lucas-Geitner
Copy link

Continue to use @import Firebase instead of #import <Firebase.h> who failed to archive on IOS

Continue to use @import Firebase instead of #import <Firebase.h> who failed to archive on IOS
@CLAassistant
Copy link

CLAassistant commented Aug 11, 2020

CLA assistant check
All committers have signed the CLA.

Copy link
Collaborator

@mikehardy mikehardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do this in my demo generator and it seems to work fine
https://github.com/mikehardy/rnfbdemo/blob/eda24a71990e95e8a91b17b27b0cc1417031808b/make-demo.sh#L19

However @Lucas-Geitner I do the old style in my work project and it also works fine

This causes you to fail to archive - using the old style?

@mikehardy mikehardy requested a review from Salakar August 11, 2020 14:47
@mikehardy mikehardy added impact: build-error Behaviour causing build failure platform: ios labels Aug 11, 2020
@Lucas-Geitner
Copy link
Author

Yes exactly, when i Archive (with fastlane) it throw an error. It doesn't with the old way.

@mikehardy
Copy link
Collaborator

Very interesting. With my demo script (using @import style) I do not attempt to archive, so I don't have experience trying it.

With my work project I use #import <Firebase.h> and it archives fine, via fastlane also, so my experience does not match yours - mine works this way and yours fails.

Why the difference? 🤔

@Lucas-Geitner
Copy link
Author

Lucas-Geitner commented Aug 12, 2020

Hello @mikehardy,

Thanks for you fast answer;
I woudn't know neither, i'm not an expert in native language;

It's a production app built with a fresh fresh new react-native 0.63 app , unfortunately, i cannot share the source code with you.

This is the error i got:

use of undeclared identifier 'FIRApp'

Tell me if i can help in any way

@Lucas-Geitner
Copy link
Author

Lucas-Geitner commented Aug 13, 2020

I found why it didn't work,

it have nothing to do with React Native Firebase 😄,

This is a related issue zoontek/react-native-bootsplash#139

👉🏻 There is now a condition in appDelegate.m in react-native 0.63 my import was after this condition.

I think we can close this issue or improved the documentation if you think you won't have any case like mine,

Thanks !

 #import "AppDelegate.h"
#import "RNBootSplash.h" 
#import <Firebase.h> // <- add the header import should be before  ifdef FB_SONARKIT_ENABLED


#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>

#ifdef FB_SONARKIT_ENABLED  //  <- THE NEW CONDITION
#import <FlipperKit/FlipperClient.h>
#import <FlipperKitLayoutPlugin/FlipperKitLayoutPlugin.h>
#import <FlipperKitUserDefaultsPlugin/FKUserDefaultsPlugin.h>
#import <FlipperKitNetworkPlugin/FlipperKitNetworkPlugin.h>
#import <SKIOSNetworkPlugin/SKIOSNetworkAdapter.h>
#import <FlipperKitReactPlugin/FlipperKitReactPlugin.h>

@mikehardy
Copy link
Collaborator

That makes a lot more sense, whew! I'm not great at Objective-C but I couldn't understand this one. There is a tips-and-tricks section on rnfirebase.io, you might add a new case "My app no longer compiles after upgrading to react-native 0.63, can't find firebase" (or the specific error, whatever it is) and then the explanation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact: build-error Behaviour causing build failure platform: ios
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants