React-native-firebase: react native firebase installation issue in ios using pods

Created on 21 Feb 2019  路  8Comments  路  Source: invertase/react-native-firebase


Issue

Unhandled JS Exception: RNFirebase core module was not found natively on iOS, ensure you have correctly included the RNFirebase pod in your projects Podfile and have run pod install.


Project Files






iOS

ios/Podfile:

Uncomment the next line to define a global platform for your project

platform :ios, '9.0'

target 'Levelz' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
use_frameworks!

# Pods for Levelz
pod 'React', :path => '../node_modules/react-native', :subspecs => [
'Core',
'CxxBridge',
'RCTImage',
'RCTNetwork',
'RCTText',
'RCTWebSocket',
'DevSupport',
'RCTAnimation',
'RCTLinkingIOS',
'RCTActionSheet'
# Add any other subspecs you want to use in your project
]

# Demo project dependencies 
# Required by RNFirebase
pod 'Firebase/Core', '~> 4.13.0'

pod 'react-native-voximplant', path: '../node_modules/react-native-voximplant'
pod 'RNCallKit', path: '../node_modules/react-native-callkit'
pod 'react-native-image-picker', path: '../node_modules/react-native-image-picker'
pod 'RNShare', path: '../node_modules/react-native-share'
pod 'BVLinearGradient', :path => '../node_modules/react-native-linear-gradient'
pod 'react-native-twitter-signin', :path => '../node_modules/react-native-twitter-signin'
pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler'
pod 'react-native-fbsdk', :path => '../node_modules/react-native-fbsdk'

# Explicitly include Yoga if you are using RN >= 0.42.0
pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

# Third party deps podspec link
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/GLog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

pod 'react-native-twitter-signin', :path => '../node_modules/react-native-twitter-signin'

post_install do |installer|
    installer.pods_project.targets.each do |target|
        if target.name == 'React'
            target.build_configurations.each do |config|
                xcconfig_path = config.base_configuration_reference.real_path
                xcconfig = File.read(xcconfig_path)
                new_xcconfig = xcconfig.sub('HEADER_SEARCH_PATHS = $(inherited)', 'HEADER_SEARCH_PATHS = $(inherited) "$(PODS_TARGET_SRCROOT)/ReactCommon/jsiexecutor"')
                File.open(xcconfig_path, "w") { |file| file << new_xcconfig }
            end
        end
        target.build_configurations.each do |config|
            config.build_settings['ENABLE_BITCODE'] = 'NO'
        end
    end

end

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

end

  • [ ] I'm not using Pods
  • [x] I'm using Pods and my Podfile looks like:
# N/A

AppDelegate.m:

import "AppDelegate.h"

import

import

import

import

import

import "RCTLinkingManager.h"

import

import

import

@implementation AppDelegate

  • (BOOL)application:(UIApplication )application didFinishLaunchingWithOptions:(NSDictionary )launchOptions
    {
    NSURL *jsCodeLocation;
    sleep(2);

    [FIRApp configure];
    [[FBSDKApplicationDelegate sharedInstance] application:application
    didFinishLaunchingWithOptions:launchOptions];

    [[Twitter sharedInstance] startWithConsumerKey:@"Ekq2rDo5IJrmY0NxC4dTlkcDn" consumerSecret:@"bjeV198GtRkLDWM5zzp4Hdt7d6B7yO40W6B3edEJd28TQjNF9m"];
    jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];

    RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
    moduleName:@"Levelz"
    initialProperties:nil
    launchOptions:launchOptions];
    //rootView.backgroundColor = [UIColor blackColor];
    rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
    UIView *view = [[UIView alloc] initWithFrame:(CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height))];

    UIImageView *launchView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"background"]];
    launchView.frame = view.frame;
    UIImageView *launchViewCenter = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"logo"]];

    double imageFrameWidth = [UIScreen mainScreen].bounds.size.width - 200 ;
    double widthImage = imageFrameWidth/4 ;

    launchViewCenter.frame = CGRectMake(100, [UIScreen mainScreen].bounds.size.height/2 - widthImage*1.5 , widthImage 4, widthImage 3);

    [view addSubview:launchView];
    [view addSubview:launchViewCenter];

    rootView.loadingView = view;

    rootView.loadingViewFadeDelay = 0.0;
    rootView.loadingViewFadeDuration = 0.15;

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

  • (BOOL)application:(UIApplication )app openURL:(NSURL )url options:(NSDictionary )options {
    return [[Twitter sharedInstance] application:app openURL:url options:options];
    }

@end

// N/A

Android

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

  • 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

  • If known, the version of the platform are you experiencing the issue on:

    • ADD_SOMETHING_HERE e.g. iOS 10 or Android API 28

  • Operating System:

    • [x ] MacOS, version: N/A

    • [ ] Windows, version: N/A

    • [ ] Other, please specify: N/A

  • Build Tools:

    • ADD_SOMETHING_HERE

  • React Native version:

    • 0.58.3

  • React Native Firebase library version:

    • 5.2.2

  • Firebase module(s) you're using that has the issue:

    • [x] N/A

    • [ ] Authentication

    • [ ] Analytics

    • [ ] Cloud Firestore

    • [ ] Cloud Messaging (FCM)

    • [ ] Crashlytics

    • [ ] Dynamic Links

    • [ ] Functions Callable

    • [ ] In App Messaging

    • [ ] Indexing

    • [ ] Invites

    • [ ] Instance ID

    • [ ] ML Kit

    • [ ] Notifications

    • [ ] Performance Monitoring

    • [ ] Realtime Database

    • [ ] Remote Config

    • [ ] Storage

  • Are you using TypeScript?

    • [x ] No

    • [ ] Yes, version: N/A

  • Are you using Expo, e.g. ExpoKit?

    • [x] No

    • [ ] Yes, I've _not_ ejected

    • [ ] Yes, but I have ejected to ExpoKit

    • [ ] Yes, but I have ejected to vanilla React Native

    • Expo version: N/A




Think react-native-firebase is great? Please consider supporting the project with any of the below:

Build Error iOS User Issue

Most helpful comment

@tusharnetset have you figured this out yet? I'm having the same issue.

All 8 comments

Hey @tusharnetset; looks like you're missing the RNFirebase pod in your Podfile:

pod 'RNFirebase', :path => '../node_modules/react-native-firebase/ios'

Also; you should be using Firebase iOS SDK version 5.15.0 for RNFirebase 5.2.2

- pod 'Firebase/Core', '~> 4.13.0'
+ pod 'Firebase/Core', '~> 5.15.0'

Loving react-native-firebase and the support we provide? Please consider supporting us with any of the below:

screen shot 2019-03-01 at 5 07 21 pm

Hii @Salakar
I got this error when i use this pod:
pod 'RNFirebase', :path => '../node_modules/react-native-firebase/ios'

@tusharnetset have you figured this out yet? I'm having the same issue.

I got the same error after following the guide of instructions pretty disappointed...

@Salakar dont understand why this line should be in the pod file when this line is part of the installation of the documentation: https://rnfirebase.io/docs/v5.x.x/installation/ios#Option-2:-Cocoapods-(Not-Recommended)

I'm having the same issue.

Closed issue. Carefully follow the template in a new issue

Was this page helpful?
0 / 5 - 0 ratings