Hello,
I am used @react-native-firebase/app plugin for configure react-native firebase in my IOS project And i imported firebase.h and [FIRApp configure] in AppDelegate.m file and its fine on debug application but whenever i am tried to archive my IOS application it gives me a error at the end of the archiving i.e. [FIRApp configure] use of undeclared identifier firapp.
Please help me to find out from this.
Here's my AppDelegate.m file
static void InitializeFlipper(UIApplication *application) {
FlipperClient *client = [FlipperClient sharedClient];
SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults];
[client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:application withDescriptorMapper:layoutDescriptorMapper]];
[client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]];
[client addPlugin:[FlipperKitReactPlugin new]];
[client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]];
[client start];
}
@implementation AppDelegate
(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
if ([FIRApp defaultApp] == nil) {
[FIRApp configure];
}
// version of @react-native-firebase/app is 8.2.0
Thank You
Looks like the problem is here:
#if DEBUG
. You're only importing it when you're in debug mode.
@andersonaddo Don't know about exact issue.
In debug application it works fine but when i archive it through me a error i.e. undefined FIRApp
Yeah and like I said it's because if you look at your file you have an if statement surrounding your imports that only allows them to be imported in debug mode
@adamrosey Okay let me check once
Non objective c developers need to learn #ifdef
and#if
keywords. It is very popular and easy logic error. : )
You're importing package in a condition. If that condition does not meet, it can't imported.
Most helpful comment
Looks like the problem is here:
#if DEBUG
. You're only importing it when you're in debug mode.