Use of undeclared identifier 'FIRApp'

Viewed 6236

After import the Firebase.h file i wrote "[FIRApp configure]" on "- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions". While running on the simulator it is showing "Use of undeclared identifier 'FIRApp'". But if select "Generic iOS device" option for build, no error is coming. Build and Archive working as properly. But on local simulator issue is coming.I have to run the app on Simulator first for crash communications with Firebase server. Please give me solution.enter

3 Answers

In AppDelegate.m file, you should import firebase like #import <Firebase.h> before #ifdef FB_SONARKIT_ENABLED line.

As I understand, You probably get success on dev build because FlipperKit libraries are used for debugging and this #ifdef FB_SONARKIT_ENABLED if condition is satisfied. When you try to archive it will not be imported and the variables will be undeclared because #import <Firebase.h> remains in that if condition.

FIRApp is moved (or initially was) to FirebaseCore framework. So.

#import <FirebaseCore/FirebaseCore.h>.

As stated in this github comment:

What work for me
Just add
#import <Firebase.h> to the AppDelegate.h as well

Source:

Related