Error message - RNFirebase core module was not found natively on iOS - ios

React Native Firebase won’t install on iOS React Native project. It works fine on Android.
I followed this instruction.
https://rnfirebase.io/docs/v5.x.x/installation/initial-setup
I set up Firebase, added the downloaded plist file via XCode, installed and set up Cocoapod.
The moment I add the following line to my App.js, the simulator returns an error message.
import firebase from 'react-native-firebase';
The error message: “RNFirebase core module was not found natively on iOS”
I’ve tried a few things I picked up from this forum:
https://github.com/invertase/react-native-firebase/issues/614
I commented out following lines from Podfile
use_frameworks!
And then pod install, pod update
on Xcode, checked the Build Phases/ Link Binary with Libraries section. I checked libRNFirebase.a was already there.
I've been trying this for a few months now on and off. And I haven't found a way to make React Native Firebase install on iOS project. Any pointer would be much appreciated.

I'm currently maintaining the react-native-firebase v5 branch (current stable) and we do have a problem with the header search paths right now for some reason.
I don't have a definitive fix, but I constructed a demo that goes from react-native init, then installs react-native-firebase, and does all the things necessary such that the project builds and runs on iOS and even archives in release mode.
You may see it here: https://github.com/mikehardy/rnfbdemo
The only thing that is important at the moment is that you need to put one non-documented thing in your Podfile after following all the install instructions, as the last line before the final end
system("mkdir -p Pods/Headers/Public/FirebaseCore && cp Pods/FirebaseCore/Firebase/Core/Public/* Pods/Headers/Public/FirebaseCore/")

Related

'File not found' when integrating React Native with existing project

I'm having problems integrating React Native into my existing iOS project. When I run the project through Xcode, everything works as expected. However, when I run the project with through the terminal (using command: npx react-native run-ios), I get an error as follows:
fatal error: 'React/RCTRootView.h' file not found
#import <React/RCTRootView.h>
It's not just RCTRootView though, it's all react native imports. The setup is done with npm and cocoapods. If I remove all the import statements in the code, I instead get this error:
framework not found CoreModules
Steps I've taken:
I followed the steps on https://reactnative.dev/docs/integration-with-existing-apps to the letter
I searched for a long time on similar issues on SO and on the React Native GitHub issues page; none of the suggested solutions work.
The fact that it all works when running through Xcode was quite confusing. I run the same configuration and scheme when running through npx.
I found the answer halfway through writing the question, so I thought I might as well post it in case it might save someone some time in the future. It took me a while because the initial error I got wasn't the core problem.
The issue was caused by the fact that I'd forgotten to update the deployment target in the target deployment info (from iOS 9 to iOS 11).
Also some cred to where I found the solution:
https://github.com/facebook/react-native/issues/26106#issuecomment-600328194

How to build a working existing react native app on iOS?

So I have an app that I have been working on for a far few months now. I developed it on Ubuntu and tested on my android phone and tablet. The app is setup using the basic react native library and I also added in expo later on for some little thing expo had that I needed. Let me know if you need more information about this.
The app is 'feature complete' and just needs to be play tested and released. So naturally I need to get it up and running on iOS. I am currently renting a mac that I can remote into (as I own no apple products).
It has been nearly a week now and I just cannot move past this error (see bottom) (or variations of what seem to be the same/similar errors). I can build a fresh app on this mac so everything is there to build react native apps. I have tried: Deleting pod and and running
pod install
running
pod deintegrate && pod install
deleting node modules and running
npm install
Initially I had an error complaining that some libraries were manually linked and this was bad so I unlinked them and now I get this error. I am opening that app using the workspace file when I run in xcode. I also get the error if running through command line i.e.
npx react-native run-ios
Using different simulators makes no difference...not sure if it is even getting that far in the build process for that to matter. I think this has something to do with the linking of RN libraries and this new auto link thing. Any thoughts? There are loads of posts with this error (or close to) that have all sorts of 'solutions', but none seem to make a difference. Overwhelmingly peoples solve this by pod install after deleting pod folder or running the pod deintegrate command. Looking at the error you can see that it prints out loads of libraries some of which I installed and others probably come with my 3rd party libraries, but some look like the core libraries and even low level looking ones that presumably RN is built on (but I honestly wouldn't know).
I was having issues before 'compiling' stuff and again I think it was to do with the linking.
Also, is there a 'react native' support service or something i.e. I pay some who knows apple and will just fix the damn thing for me
ERROR (scroll to the bottom for what is probably the important bit):
https://pastebin.com/HMdP4x3P
[EDIT]
I think this has something to do with my podfile: https://pastebin.com/5J7BbG2Q other pod files do not look like mine.

'FBSDKShareKit/FBSDKShareKit.h' file not found

I've made an IOS build on Unity for an App we're making after adding the facebook SDK, moved the build on a hard drive and tried to build it on xcode on the mac we have at the office, as I always do before uploading it to the app store. I ran into this error and I've been stuck on this issue for 2 full work days and it's driving me a bit crazy, here are the thing's I've tried:
-Install cocoapods, both on the default terminal directory and on the project's directory (I'm not too experienced with cocoapods so I don't know if that made a difference. I also did pod update while standing on the project directory).
-I saw that the IOS resolver has an option called "generate pod files" that people said needed to be checked when building to solve this issue. It was checked by default on my project, so that wasn't it.
-Added the framework path on the build settings to where the facebook SDK is at (though the way it looked on my xcode seemed a bit different than the way I've seen it on other people's xcode screenshots)
-Tried commenting out some #include lines on the headers that are generating the issue. It only produced more errors.
-People said to open the project from the workspace instead of the xcodeproject but unity doesn't seem to generate a workspace file.
-Tried downgrading the Facebook SDK to a previous version but the versions people claim are working don't seem to be on the repository anymore, so it doesn't let me downgrade to them.
At the moment I'm trying to make it work with the latest Facebook SDK which is 9.0.0.
Any help would be appreciated, please let me know if I'm not being specific enough about the issue or if there's any information about my project I should include on the post
The .xcworkspace should be created by Cocoapods, not by Unity directly.
If you already have the Podfile generated, just run pod install on the project directory and open the created .xcworkspace file after Cocoapods finishes installing the external dependencies.

UMModuleRegistryAdapter.h not found when running React Native app in iOS simulator

I have a simple React Native app that I've been testing on Android and now want to test on iOS. It's using React Navigation.
I ran npm run ios but I'm getting the following error:
info In file included from
/Users/rbbit/reactnative/testproj1/ios/testproj1/main.m:10:
/Users/rbbit/reactnative/testproj1/ios/testproj1/AppDelegate.h:9:9: fatal error: 'UMReactNativeAdapter/UMModuleRegistryAdapter.h' file not found
#import <UMReactNativeAdapter/UMModuleRegistryAdapter.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
info 1 error generated.
I opened XCode but I'm basically getting the same message, nothing else that would help me debug this.
I do see that there is a package called react-native-adapter (https://github.com/expo/expo/tree/master/packages/%40unimodules/react-native-adapter), however I'm hesitant to just install this since I followed the instructions on how to include react-navigation and didn't mention that, assuming this is related.
Also, that page says If you are using react-native-unimodules, this package will already be installed and configured!, and react-native-unimodules already is in my dependencies.
Any pointers on how to solve this? Thank you!
For latest RN versions (RN 0.60+) errors like this should be fixed with the auto-linking and just running a pod install.
For older versions you should try:
react-native link in the root folder of your project
Then in Xcode Product->Clean Build folder, restart JS server and attempt to rebuild.
If still not working double check the configs from here:
https://github.com/unimodules/react-native-unimodules
and the App.delegate from here:
https://gist.github.com/brentvatne/1ece8c32a3c5c9d0ac3a470460c65603
Sources:
Pod install reminder was first suggested by Sandy in the below comment
pod install didn't work for me until I added these lines to my pod file:
require_relative '../node_modules/react-native-unimodules/cocoapods.rb'
And
use_unimodules!(modules_paths: ['../node_modules'])
Then do a pod install.
Example: https://gist.github.com/sjchmiela/6c079f2173938a9a61a7c6f053c45000
I had this exact same error with everything configured correctly, everything in the other answers done and all the unimodules installation steps already done, on a project that had worked for months, building it on a new computer. It turned out the reason was because I was simply using the wrong file in xCode.
I had opened the .xcodeproj file when I should have opened and run the build from the .xcworkspace file.
Everything seemed to work as normal apart from this error, which made it look like a configuration problem rather than a simple "you opened the wrong file" problem. Hopefully if someone else makes the same mistake, this will save them a few hours of fruitless tinkering.

Xcode showing error 'No such module' even though I've installed Cocoapods and installed pod file of Dialogflow

I've been making a chatbot using Dialogflow formerly Api.AI but now encountering error while integrating the project to my app written in Swift in Xcode. I'd installed cocoapods using terminal "sudo gem install cocoapods" and using this version of Dialogflow to create the podfile.
All gone well but now when I'm importing inside Xcode in my app's AppDelegate.swift file using import ApiAI or import AI Xcode is showing me error that No such module. Please refer to image.
And on GitHub this library which is written in Swift, showing that it has depreciated and asking me to refer to API.AI's Apple Client library which is in Obj-C and unfortunately I've no expertise in Obj-C.
After installing a pod using Cocoa Pods, you must from that point forward open the workspace rather that the project file. The icons will appear differently in your project like so:
In the image you provided is clearly showing that you have opened the project file not the workspace one.
Go to Pods Build settings and set Build Active Architecture Only to NO. This always helps while using pods. After that clean the project once and then build.
After installing pod you should clean project (shift + command + k) and then builds (command + b) in it a few times. Repeat it a few times if it is not still working.
Hope this help!

Resources