'Use of undeclared identifier 'FIRApp'

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



Solution 1:[1]

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.

Solution 2:[2]

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

#import <FirebaseCore/FirebaseCore.h>.

Solution 3:[3]

What works for me, Just add #import <Firebase.h> to the

AppDelegate.h

as well enter image description here enter link description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Amir Doreh
Solution 2 arturdev
Solution 3 paydarsefat