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

FirebaseCore/FIRApp.h not found #377

Closed
amrdraz opened this issue Apr 9, 2017 · 21 comments
Closed

FirebaseCore/FIRApp.h not found #377

amrdraz opened this issue Apr 9, 2017 · 21 comments

Comments

@amrdraz
Copy link

amrdraz commented Apr 9, 2017

I am unable to build my app I'm getting FirebaseCore/FIREApp.h not found

I have tried this on a new project as well

my pod file is as follows

  use_frameworks!
  pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
  pod 'React', :path => '../node_modules/react-native', :subspecs => [
    'Core',
    'RCTText',
    'RCTNetwork',
    'RCTWebSocket', # needed for debugging
    # Add any other subspecs you want to use in your project
  ]

  pod 'Firebase/Core'
  pod 'Firebase/Messaging'

the output is

Using Firebase (3.3.0)
Using FirebaseAnalytics (3.2.1)
Using FirebaseInstanceID (1.0.7)
Using FirebaseMessaging (1.1.0)
Using GoogleIPhoneUtilities (1.2.1)
Using GoogleInterchangeUtilities (1.2.1)
Using GoogleSymbolUtilities (1.1.1)
Using GoogleUtilities (1.3.1)
Using React (0.42.3)
Using Yoga (0.42.3.React)

I am running "react-native": "0.42", "react-native-fcm": "^6.2.0"

my AppDelegate.h is

#import <UIKit/UIKit.h>
@import UserNotifications;

@interface AppDelegate : UIResponder <UIApplicationDelegate,UNUserNotificationCenterDelegate>

@end

my AppDelegate.m is

#import "AppDelegate.h"

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

#import "RNFIRMessaging.h"

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{

  NSURL *jsCodeLocation;

  jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];

  RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
                                                      moduleName:@"EFGConnect"
                                               initialProperties:nil
                                                   launchOptions:launchOptions];
  rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];

  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  UIViewController *rootViewController = [UIViewController new];
  rootViewController.view = rootView;
  self.window.rootViewController = rootViewController;
  [self.window makeKeyAndVisible];

  // ================ FCM =============================

  [FIRApp configure];
  [[UNUserNotificationCenter currentNotificationCenter] setDelegate:self];

  // ================================================


  return YES;
}

- (void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler
{
  [RNFIRMessaging willPresentNotification:notification withCompletionHandler:completionHandler];
}

- (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)())completionHandler
{
  [RNFIRMessaging didReceiveNotificationResponse:response withCompletionHandler:completionHandler];
}

//You can skip this method if you don't want to use local notification
-(void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification {
  [RNFIRMessaging didReceiveLocalNotification:notification];
}

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(nonnull NSDictionary *)userInfo fetchCompletionHandler:(nonnull void (^)(UIBackgroundFetchResult))completionHandler{
  [RNFIRMessaging didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
}

@end

@smontlouis
Copy link
Contributor

Similar to #230

pod updateand pod update repoand everything should be fine

@amrdraz
Copy link
Author

amrdraz commented Apr 9, 2017

I managed to get the project working by not using pods and including the framework manually as it is done in the Example SimpleProject

I will try update for completeness

@geekvijay
Copy link

i am facing same issue using Cocoapods approach

@amrdraz
Copy link
Author

amrdraz commented Apr 11, 2017 via email

@geekvijay
Copy link

@amrdraz manual approach also didn't worked for me :(

@amrdraz
Copy link
Author

amrdraz commented Apr 11, 2017

@geekvijay did you try setting up and running the example app to see if it works for you?

@amrdraz
Copy link
Author

amrdraz commented Apr 11, 2017

And when you say works for you you are referring to the build error at the top of the issue right?

just checking
to integrate the manual solution what I did was
clone this repo
copy the frameworks folder into my project
go to my project target -> general -> linked frameworks and Libraries
and added all the .framework files and libz.tbd

@ibratoev
Copy link
Contributor

I hit a few similar issues configuring the module. Here is the approach I took that worked great for me: #380

@Fantasim
Copy link

Fantasim commented May 2, 2017

#380 doesn't help me, i've already this problem, is it possible to fix it to make it works with classic setup ?

@mienaikoe
Copy link

mienaikoe commented Jun 3, 2017

Also getting this issue. @ibratoev, I cannot remove use_frameworks! from my podfile. There is another react-native module that relies on it.

This issue is really rough as it prevents linking of the app. I've been trying to find a workaround all night, to no avail. Would really appreciate someone to weigh in here. It refers to the nonexistence of #import <FirebaseCore/FIRApp.h> in RNFIRMessaging.h

Here's the breakdown:
I am using a Podfile with inherit! :search_paths

  • if I use_frameworks!, then I get the FIRApp.h error.
  • if I comment out use_frameworks!, then I get a ton of Linker errors:
    screen shot 2017-06-02 at 11 41 58 pm

Just need to know how to make FIRApp.h available - whether on the react-native-fcm side or in our projects somewhere.

@mienaikoe
Copy link

mienaikoe commented Jun 3, 2017

Okay I removed inherit! :search_paths and it works. ¯\_(ツ)_/¯

@evollu
Copy link
Owner

evollu commented Jun 11, 2017

seems it is fixed. updated readme with solution

@evollu evollu closed this as completed Jun 11, 2017
@ifalldev
Copy link

ifalldev commented Jun 22, 2017

@amrdraz, there is no framework folder in Examples/simple-fcm-client and inside the Xcode project the files in framework folder can't be found. How did you do that?
captura de tela 2017-06-22 as 10 45 35

@evollu
Copy link
Owner

evollu commented Jun 26, 2017

@ifalldev example project has been changed to rely on cocoapod because Firebase didn't project framework packages for v4.0

@icarus-sullivan
Copy link

icarus-sullivan commented Aug 3, 2017

@bulby97

This worked for me ...

Newer versions may require a different set of commands though

pod update
pod install --repo-update

@neilakoh
Copy link

neilakoh commented Aug 7, 2017

@bulby97 thanks a lot

pod update
pod install --repo-update

did the trick for me

@uditchandhoke1912
Copy link

Getting this error " 'FirebaseCore/FIRApp.h' file not found " even after running pod update and pod repo update. Any solutions??

@uditchandhoke1912
Copy link

btw my react native version is 0.44

@jraack
Copy link

jraack commented Jun 21, 2018

@uditchandhoke1912 got same problem, running old version react 0.44
you got it fixed?

@uditchandhoke1912
Copy link

uditchandhoke1912 commented Jun 22, 2018

@jraack yes, initially I ran "react-native link react-native-fcm" for linking npm package and it showed me that the package is linked but it was not linking properly due to some reason and not adding "pod Firebase/Messaging" in podFile. So, I configured fcm manually by following this: https://github.com/evollu/react-native-fcm.
Basically it is asking you to do following steps:

  1. In XCode, in the project navigator, right click Libraries ➜ Add Files to [your project's name]
2. Go to node_modules ➜ react-native-fcm and add RNFIRMessaging.xcodeproj

3. In XCode, in the project navigator, select your project. Add libRNFIRMessaging.a to your project's Build Phases ➜ Link Binary With Libraries

4. Click RNFIRMessaging.xcodeproj in the project navigator and go the Build Settings tab. Make sure 'All' is toggled on (instead of 'Basic'). In the Search Paths section, look for Header Search Paths and add $(SRCROOT)/../node_modules/react-native-fcm/ios and mark as recursive.
```
then, in terminal
```
cd ios
vim Podfile
```
then, add following entry in Podfile
```
# For FCM

pod 'Firebase/Messaging'
then, in terminal
pod install
In firebase console, you can get GoogleService-Info.plist file and place it in /ios/your-project-name directory (next to your Info.plist)

@ksjmb
Copy link

ksjmb commented May 20, 2019

@bulby97 Thanks...!

This worked for me...!

pod update
pod install --repo-update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests