React-native-firebase: RNFirebaseAuth.h React/RCTEventEmitter.h file not found

Created on 22 Oct 2017  路  2Comments  路  Source: invertase/react-native-firebase

screen shot 2017-10-22 at 9 13 38 am

Issue

Trying to build project from XCode with target Simulator IPhone SE
just initialized fresh project on react native v0.49.3
Followed guide https://rnfirebase.io/docs/v3.0.*/installation/ios

Getting this error durig compilation

/node_modules/react-native-firebase/ios/RNFirebase/auth/RNFirebaseAuth.h:8:9: 'React/RCTEventEmitter.h' file not found

in RNFirebaseAuth:8 i have

#import <React/RCTEventEmitter.h>

Pod file

install! 'cocoapods', :deterministic_uuids => false
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'

target 'moneybelka' do
  platform :ios, '9.0'
  # Uncomment this line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for ReactNativeFirebaseExamples
  react_native_path = "../node_modules/react-native"

  pod 'Firebase/Core'
  pod 'Firebase/Auth'
  pod 'Firebase/Database'
  pod 'RNFirebase', :path => '../node_modules/react-native-firebase'
  pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
  # pod 'Firebase/Analytics'
  # pod 'Firebase/Crash'
  # pod 'Firebase/DynamicLinks'
  # pod 'Firebase/Messaging'
  # pod 'Firebase/RemoteConfig'
  # pod 'Firebase/Storage'
  # pod 'Fabric'
  # pod 'Crashlytics'

  # pod 'CodePush', :path => '../node_modules/react-native-code-push'
end

i cleaned project (SHIFT+CMD+K)

i cleaned derived data

rm -rf /ios/build && rm -rf ~/Library/Developer/Xcode/DerivedData

Environment

  1. Application Target Platform: IOS

  2. Development Operating System: macOS High Sierra

  3. Build Tools: XCode 9.0.1

  4. React Native version: 0.49.3

  5. RNFirebase Version: 3.0.4

  6. Firebase Module: Auth

Most helpful comment

@coderany You've specified RNFirebase as a pod rather than linking using react-native link. This has changed in 3.0.X to simplify things and fix issues like this.

To resolve, you have two options:

1) Remove the RNFirebase pod, run pod install and then react-native link
2) You'll have to add the React pod to the pod file as explained in the 2.0.x instructions: https://rnfirebase.io/docs/v2.2.*/installation-ios#2.1)-Add-the-required-pods

All 2 comments

@coderany You've specified RNFirebase as a pod rather than linking using react-native link. This has changed in 3.0.X to simplify things and fix issues like this.

To resolve, you have two options:

1) Remove the RNFirebase pod, run pod install and then react-native link
2) You'll have to add the React pod to the pod file as explained in the 2.0.x instructions: https://rnfirebase.io/docs/v2.2.*/installation-ios#2.1)-Add-the-required-pods

Just want to share my solution (for my future reference also)
using pod, React-Native version 0.49.5

  pod 'Firebase/Core'
  pod 'Firebase/Messaging'
  pod 'RNFirebase', :path => '../node_modules/react-native-firebase'
  pod "yoga", :path => "../node_modules/react-native/ReactCommon/yoga"
  pod 'React', :path => '../node_modules/react-native', :subspecs => [
  'BatchedBridge', # Required For React Native 0.45.0+
  'Core',
]
Was this page helpful?
0 / 5 - 0 ratings

Related issues

Damnum picture Damnum  路  3Comments

joecaraccio picture joecaraccio  路  3Comments

jonaseck2 picture jonaseck2  路  3Comments

dgruseck picture dgruseck  路  3Comments

alizahid picture alizahid  路  3Comments