React-native-firebase: [FIRApp configure] use of undeclared identifier firapp

Created on 24 Jul 2020  路  5Comments  路  Source: invertase/react-native-firebase

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

import "AppDelegate.h"

import

import

import

if DEBUG

import

import

import

import

import

import

import

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];
}

endif

@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

Build Error User Issue

Most helpful comment

Looks like the problem is here:
#if DEBUG. You're only importing it when you're in debug mode.

All 5 comments

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.

Was this page helpful?
0 / 5 - 0 ratings