React-native-firebase: FirebaseCore.h file not found when product archive is used

Created on 10 Sep 2019  路  4Comments  路  Source: invertase/react-native-firebase


Issue



I just finished creating an app with React Native, which has been working fine, without errors. Now that I want to use the 'archive' option for deployment, XCode shows the following error:
"/ios/Pods/Headers/Public/Firebase/Firebase.h:1:9: 'FirebaseCore/FirebaseCore.h' file not found"
image

versions:
"react": "16.8.3",
"react-native": "0.59.8",
"react-native-firebase": "^5.5.6",

I've tried all I've seen on similar issues, but nothing has worked so far.
And yes, I'm using xcworkspace.


Project Files






iOS

Click To Expand

#### `ios/Podfile`: - [ ] I'm not using Pods - [x] I'm using Pods and my Podfile looks like:

# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'

target 'sportscave' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  # Pods for sportscave
  pod 'Firebase'
  pod 'Firebase/Core'
  pod 'Firebase/Analytics'
  pod 'Firebase/Messaging'

  target 'sportscaveTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

#### `AppDelegate.m`:
/**
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
#import <Firebase.h>
#import "AppDelegate.h"
#import "RNFirebaseNotifications.h"
#import "RNFirebaseMessaging.h"

#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import "RNSplashScreen.h"

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  [FIRApp configure];
  [RNFirebaseNotifications configure];
  RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
  RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
                                                   moduleName:@"sportscave"
                                            initialProperties:nil];

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

  [RNSplashScreen show];
  return YES;
}

- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
  return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
#else
  return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
}

- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification {
  [[RNFirebaseNotifications instance] didReceiveLocalNotification:notification];
}

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

- (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings {
  [[RNFirebaseMessaging instance] didRegisterUserNotificationSettings:notificationSettings];
}

@end


Android

Click To Expand

#### Have you converted to AndroidX? - [ ] my application is an AndroidX application? - [ ] I am using `android/gradle.settings` `jetifier=true` for Android compatibility? - [ ] I am using the NPM package `jetifier` for react-native compatibility? #### `android/build.gradle`:

// N/A
#### `android/app/build.gradle`:
// N/A
#### `android/settings.gradle`:
// N/A
#### `MainApplication.java`:
// N/A
#### `AndroidManifest.xml`:
<!-- N/A -->


Environment

Click To Expand

**`react-native info` output:**

 OUTPUT GOES HERE
- **Platform that you're experiencing the issue on**: - [x ] iOS - [ ] Android - [ ] **iOS** but have not tested behavior on Android - [ ] **Android** but have not tested behavior on iOS - [ ] Both - **`react-native-firebase` version you're using that has this issue:** - "^5.5.6" - **`Firebase` module(s) you're using that has the issue:** - Forebase Core - **Are you using `TypeScript`?** - N




Think react-native-firebase is great? Please consider supporting all of the project maintainers and contributors by donating via our Open Collective where all contributors can submit expenses. [Learn More]

Most helpful comment

as @mikehardy said, check this out :) https://github.com/invertase/react-native-firebase/issues/2283#issuecomment-529988424

I guess you're using use_framework! in Podfile? Then you would need this.

All 4 comments

After just working through something similar with someone else here https://github.com/invertase/react-native-firebase/issues/2283 I'm going to say your easiest bet is to do the upgrade to react-native 0.60.

If you really want to fight it you'll probably have to do some header copying or similar.

I demonstrate an rn59 app creation here - and it works fine through release - maybe it is illuminating? https://github.com/mikehardy/rnfbdemo/blob/master/make-demo-rn59.sh

(note especially that when you do react-native link in rn59, you will want to make sure your Podfile is not in place, as that would cause react-native-firebase to be pod-linked instead of framework-linked, which is not supported in rn59 - my script does things in the right order so there is no Podfile when react-native link is executed)

(note especially that when you do react-native link in rn59, you will want to make sure your Podfile is _not_ in place, as that would cause react-native-firebase to be pod-linked instead of framework-linked, which is not supported in rn59 - my script does things in the right order so there is no Podfile when react-native link is executed)

Oh ok. I was trying to solve it without updating react native, since it had some breaking changes last time I did it. How hard would it be to fix it with rn59? I'm assuming it could be by moving the pod file during react native linking and then copying it back.

as @mikehardy said, check this out :) https://github.com/invertase/react-native-firebase/issues/2283#issuecomment-529988424

I guess you're using use_framework! in Podfile? Then you would need this.

Was this page helpful?
0 / 5 - 0 ratings