invertase / react-native-firebase

🔥 A well-tested feature-rich modular Firebase implementation for React Native. Supports both iOS & Android platforms for all Firebase services.
https://rnfirebase.io
Other
11.69k stars 2.21k forks source link

'FirebaseCore/FIRAnalyticsConfiguration.h' file not found on v5 #1106

Closed stereodenis closed 6 years ago

stereodenis commented 6 years ago

@chrisbianca image

PODS:
  - Firebase (5.0.1):
    - Firebase/Core (= 5.0.1)
  - Firebase/Auth (5.0.1):
    - Firebase/CoreOnly
    - FirebaseAuth (= 5.0.0)
  - Firebase/Core (5.0.1):
    - Firebase/CoreOnly
    - FirebaseAnalytics (= 5.0.0)
  - Firebase/CoreOnly (5.0.1):
    - FirebaseCore (= 5.0.1)
  - Firebase/Messaging (5.0.1):
    - Firebase/CoreOnly
    - FirebaseMessaging (= 3.0.0)
  - FirebaseAnalytics (5.0.0):
    - FirebaseCore (~> 5.0)
    - FirebaseInstanceID (~> 3.0)
    - "GoogleToolboxForMac/NSData+zlib (~> 2.1)"
    - nanopb (~> 0.3)
  - FirebaseAuth (5.0.0):
    - FirebaseCore (~> 5.0)
    - GTMSessionFetcher/Core (~> 1.1)
  - FirebaseCore (5.0.1):
    - "GoogleToolboxForMac/NSData+zlib (~> 2.1)"
  - FirebaseInstanceID (3.0.0):
    - FirebaseCore (~> 5.0)
  - FirebaseMessaging (3.0.0):
    - FirebaseCore (~> 5.0)
    - FirebaseInstanceID (~> 3.0)
    - GoogleToolboxForMac/Logger (~> 2.1)
    - Protobuf (~> 3.1)
  - GoogleToolboxForMac/Defines (2.1.4)
  - GoogleToolboxForMac/Logger (2.1.4):
    - GoogleToolboxForMac/Defines (= 2.1.4)
  - "GoogleToolboxForMac/NSData+zlib (2.1.4)":
    - GoogleToolboxForMac/Defines (= 2.1.4)
  - GTMSessionFetcher/Core (1.1.15)
  - nanopb (0.3.8):
    - nanopb/decode (= 0.3.8)
    - nanopb/encode (= 0.3.8)
  - nanopb/decode (0.3.8)
  - nanopb/encode (0.3.8)
  - Protobuf (3.5.0)

"react-native": "0.54.0" "react-native-firebase": "^4.2.0"

What's wrong?

NirpE commented 6 years ago

I'm encountering the same issue, any known workarounds on this?

jerinjohnk commented 6 years ago

Was getting the same error. So as per the comment @dluksza in #1106 Updated podfile to use version 4.2.0

pod 'Firebase/Core','4.2.0'
pod 'Firebase/Messaging','4.2.0'

But this instead gave me following error while creating a debug build. *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[RNFirebaseMessaging messaging:didRefreshRegistrationToken:]: unrecognized selector sent to instance 0x137ebbd20'

chrisbianca commented 6 years ago

You need to make sure you are on:

Javascript: react-native-firebase: v4.2.0

Pods: Firebase/Core: v5+

This is explained in the v4.2.0 release notes.

Once you have updated your pods and npm libraries, please make sure you clean your build within XCode (I suggest restarting once you have), and then rebuilding. This is definitely a case of npm/pods/Xcode getting out of sync and there are no issues when everything is correctly installed.

jerinjohnk commented 6 years ago

@chrisbianca thanks. Did a pod update which somehow fixed the issue.

vishal-android-freak commented 6 years ago

I am facing

FirebaseCore/FirebaseCore.h not found

I am on v4.2 and my pods are updated and Firebase is > 5.0

Any help?

rikur commented 6 years ago

Cocoapods can be tough to work it, some thoughts:

vishal-android-freak commented 6 years ago

@rikur tried it couple of times. Same issue persists.

NirpE commented 6 years ago

I get

'FirebaseCore/FIRAnalyticsConfiguration.h' file not found

when trying to archive. Deleted pods and node_modules and reinstalled them but didn't help.

Porshe commented 6 years ago

FirebaseCore/FirebaseCore.h not found

when trying to archive.

wanbok commented 6 years ago

I got the same issue. This issue is not resolved yet.

wanbok commented 6 years ago

My solution is downgrade to RNFirebase to 4.1.0, Firebase/Core and Firebase/Message to ~> 4.13

NirpE commented 6 years ago

@wanbok if you archive app does everything work normally? Are you using Firebase Functions? Care to share your Podfile lines for all Firebase dependencies?

zkrige commented 6 years ago

FirebaseCore/FirebaseCore.h not found same issue when trying to archive. Run on device works fine, only archive is failing

Rojuinex commented 6 years ago

How come this issue is closed? I have the same issue. Doesn't seem resolved.

azraelx23 commented 6 years ago

yep same issue here

pearlismylove commented 6 years ago

Same here~

oferRounds commented 6 years ago

+1

brianinator commented 6 years ago

I have same issue that the author reported. I've tried clean & archive, pod install without use_frameworks!, pod update and restart Xcode.

Podfile:

target '...' do
  use_frameworks!

  # Pods for AppCenter
  pod 'AppCenter/Crashes', '~> 1.4.0'
  pod 'AppCenterReactNativeShared', '~> 1.3.0'
  pod 'AppCenter/Analytics', '~> 1.4.0'

  # Pod for Firebase
  pod 'Firebase/Core'

  platform :ios, '10.0'
end

react-native-firebase: 4.2.0 firebase-ios-sdk: v5

I am successfully running it on simulator.

Update: I decided to downgrade to react-native-firebase 4.1.0 and firebase sdk 4.13.0. After which, I began to have issues finding other react-native libraries and so I manually linked each library (instead of react-native link). Then, continued to have issues with Pods framework script and so I pod install again and I got warnings about PODS_CONFIGURATION_BUILD_DIR and I followed the suggested by updating to $(inherited) and then ran pod install again. And so no more warnings and I then proceeded to add user defined setting REACT_HEADER_PATH set to ${PODS_BUILD_DIR}/Release$(EFFECTIVE_PLATFORM_NAME)/include for my custom build configurations and added to header search paths set to recursive. I tested archiving each build configuration it was back to normal.

jerinjohnk commented 6 years ago

Using npm list my current versions

* React Native version: 0.55.4
* react-native-firebase@4.2.0

I updated my podfile according to this Medium article After that I am successfully able to create an archive build. On validating it did pass validation. Could you please try updating your podfile accordingly

Benjumali commented 6 years ago

This issue does not seem to be resolved, have not found a decent solution.

uditalias commented 6 years ago

+1

aaronkchsu commented 6 years ago

Hmmm same for me archive is failing, I can run the app on the simulator! It's been painful to try and fix haha! Help!

oferRounds commented 6 years ago

any solution? someone?

vishal-android-freak commented 6 years ago

@chrisbianca could you please update us here? Apologies but my production release is pending because of this 😅

oferRounds commented 6 years ago

@vishal-android-freak Actually I was just able to solve it (finally!) by removing the use_frameworks from the pod file, while using a 1.5+ version of cocoa pods, and adding the :modular_headers => true for specific pods which depend on Obj-C code.

More info can be found here: http://blog.cocoapods.org/CocoaPods-1.5.0/

vishal-android-freak commented 6 years ago

I can confirm deleting pods folder, pod lock files and xcworkspace file, remove use_frameworks from Podfile and reinstalling has fixed the issue. Will observe for few days and revert if I see some changes. Thankyou @oferRounds 👍

Friis1978 commented 6 years ago

@chrisbianca @oferRounds @vishal-android-freak perhaps you could help me.

I have the exact same problem, I have struggled with this issue for weeks, and have tried everything, also the suggestions mentioned here.

In my react native app i also use the react-native-mapbox, and it seems like some of the stuff used for this has an effect on firebase.

Perhaps some of you could show me a full guide to add firebase manually, seems like that could help, I cant really find any tutorials how to do this on new versions of xCode.

This is my pod file:

use_frameworks!

Flexbox Layout Manager Used By React Natve

pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga/Yoga.podspec'

React Native

pod 'React', path: '../node_modules/react-native', subspecs: [

Comment out any unneeded subspecs to reduce bundle size.

'Core',
'DevSupport',
'RCTActionSheet',
'RCTAnimation',
'RCTBlob',
'RCTCameraRoll',
'RCTGeolocation',
'RCTImage',
'RCTNetwork',
'RCTPushNotification',
'RCTSettings',
'RCTTest',
'RCTText',
'RCTVibration',
'RCTWebSocket',
'RCTLinkingIOS'

]

Mapbox

pod 'react-native-mapbox-gl', :path => '../node_modules/@mapbox/react-native-mapbox-gl'

Firebase

pod 'Firebase/Core' pod 'Firebase/Auth' pod 'Firebase/Database'

vishal-android-freak commented 6 years ago

@Friis1978 remove use_frameworks! from pod file and delete Pods folder, lockfile xcworkspace, etc. and do pod install again

Friis1978 commented 6 years ago

@vishal-android-freak Thank you very much, I had already done that several times, bu this is what I did, which worked (finally):

  1. Make a whole new React native project. (react-native init dummyproject)
  2. Install cocoapods in the project. (version 1.5.0)
  3. Install all repos from the old project.
  4. Copy & paste old projects podfile content to the new project.
  5. Pod Install
  6. Run project in xCode. ( Remember to use the xcworkspace file when using Cocoapods )
  7. Find the Seach Path, and copy the paths to the old project.
  8. Clean the old project.
  9. Run the old project.
  10. Old project is working correctly.

This is the Seach paths from my project:

screenshot 2018-07-22 01 09 50

And this is the podfile content:

target 'guard4me' do

Flexbox Layout Manager Used By React Natve

pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga/Yoga.podspec'

React Native

pod 'React', path: '../node_modules/react-native', subspecs: [

Comment out any unneeded subspecs to reduce bundle size.

'Core',
'DevSupport',
'RCTActionSheet',
'RCTAnimation',
'RCTBlob',
'RCTCameraRoll',
'RCTGeolocation',
'RCTImage',
'RCTNetwork',
'RCTPushNotification',
'RCTSettings',
'RCTTest',
'RCTText',
'RCTVibration',
'RCTWebSocket',
'RCTLinkingIOS'

]

Mapbox

pod 'react-native-mapbox-gl', :path => '../node_modules/@mapbox/react-native-mapbox-gl'

Svg

pod 'RNSVG', :path => '../node_modules/react-native-svg'

Pods for iosfirebase

pod 'Firebase/Core', '~> 4.13.0' pod 'Firebase/Auth' pod 'Firebase/Database' pod 'RNBackgroundFetch', :path => '../node_modules/react-native-background-fetch' end

vishal-android-freak commented 6 years ago

@Friis1978 I am glad it is finally all good and working :)

kesha-antonov commented 6 years ago

Same here. 'FirebaseCore/FirebaseCore.h' file not found when doing Archive

wanbok commented 6 years ago

@NirpE Sorry for a late response. Everything that I used, works normally. But I use it with just a few functions.

jamesreilly5 commented 6 years ago

Same problem for me, the only workaround that worked was downgrading to 4.1.0 😞

mbbender commented 6 years ago

I solved this problem by upgrading my packages. RN 0.56, RNF 5.0-rc1, pod Firebase/Core 5.6

phuongwd commented 6 years ago

same problem for me, issue RN 0.56, RNF 5.0-rc1, pod Firebase/Core 5.6

AdriaRios commented 6 years ago

Any oficial solution for this issue?

abdullahceylan commented 6 years ago

It should be solved.

SudoPlz commented 6 years ago

@oferRounds I'm trying to figure the solution I should use on my end.

You see our project is an Objective-C project that requires a swift library (PromiseKit) - and not the opposite.

If I just remove use_frameworks! from our podfile, it won't build because libraries like swiftCoreFoundation will be missing.

What is the right way to remove use_frameworks! AND keep those swift pods working?

Here's my podfile:

platform :ios, '10.0'

target 'TestApp' do

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

    # Tried adding modular_headers but it doesn't seem to work    
    pod 'PromiseKit', :modular_headers => true     

    # react-native-firebase
    pod 'Firebase/Core', '~> 5.3.0'
    pod 'Firebase/DynamicLinks', '~> 5.3.0'
    pod 'Firebase/Messaging', '~> 5.3.0'

end

Thank you

oferRounds commented 6 years ago

@SudoPlz have you tried the things here? https://github.com/invertase/react-native-firebase/issues/1106#issuecomment-405030305

SudoPlz commented 6 years ago

@oferRounds I have tried adding :modular_headers => true next to pod 'PromiseKit' as you can see above (after commenting out the use_frameworks! line, but it still fails on build time, telling me that basic swift libraries like swiftCoreFoundation were not found.

My cocoapods knowledge is not that great, but I did try that at least. Is that not what I was supposed to do?

oferRounds commented 6 years ago

@SudoPlz can you check which Cocoa Pods version are you using? It should be at least 1.5.0

https://stackoverflow.com/questions/18931091/how-to-check-a-version-of-a-cocoapods-framework

SudoPlz commented 6 years ago

@oferRounds

pod --version
1.5.3
oferRounds commented 6 years ago

Got you. And which Xcode version?

SudoPlz commented 6 years ago

Xcode 10.0 using the default (modern) Xcode build system

oferRounds commented 6 years ago

Got you... Then, sorry, for some reason this solution does not work for you. Not Sure what’s the reason. Obviously there is some issue with react-native-firebase, I hope it will be fixed soon..

SudoPlz commented 6 years ago

Cool, thanks for helping out on a Sunday man, I appreciate it.

oferRounds commented 6 years ago

Sure! :) Sorry I couldn’t solve it :\

phips28 commented 6 years ago

I just removed the use_frameworks! from my Podfile.

Jackyaung commented 5 years ago

have been working this for more then three days, no matter how I tried, it just keep telling you , either Firebase not found or FirebaseCore/FirebaseCore.h not found.

mikehardy commented 5 years ago

I have just recently used the firebase starter with XCode 10.1/XCode10.2 (just came out) and it works.

I then carefully adapted what the starter did into my codebase (using RN0.59.1 even) and it works.

There are a million ways to mess up a build system but if it helps to know that the starter works so you have a template to look through, and that the current 5.x code works if you carefully pull the starter's style in, maybe you can move forward