'React/RCTBridgeDelegate.h' file not found - react-native

I did all to solve this issue, most of advised Remove node_modules files, remove pod files, and then update node, React Native, and install fresh pod but still facing following issue.
'React/RCTBridgeDelegate.h' file not found
Also I noticed pod file came with no depdencies while it should added all react depedencies.
This is what my pod file looks like.
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'pinnacle' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for pinnacle
end

Related

'FirebaseCore/FirebaseCore.h' file not found in RNFIRMessaging.h

In Podfile, when using use_frameworks! globally to integrate swift pods in my react native project, Firebase pod files starts giving error
Firebase pods:-
pod 'Firebase'
pod 'Firebase/Messaging'
Error :-
'FirebaseCore/FirebaseCore.h' file not found in RNFIRMessaging.h
issue gets resolved when comment out use_frameworks! in podfile but then i am unable to install swift pods. also tried :modular_headers => true for specific swift pods but pod file is not installing.
Swift pods i am trying to install are :-
pod 'Kite-Print-SDK'
pod 'PayPal-iOS-SDK/Core'
please help me out to resolve this issue..
Please consider check at edit scheme ->Build -> check if Find Implicit Dependencies. if not enable please enable it and rerun.
I actually had a similar problem,
my solution was to change the code manually wherever there was that error.
change
import <FirebaseCore/FirebaseCore.h>
to
import <FirebaseCore.h>

FirebaseMessaging module not found

When ever I write #import FirebaseMessaging; is says -
Module 'FirebaseMessaging' not found
What I did - I install the pods with only Firebase/Core, but after that I realised Firebase/Messaging is also necessary to enable push notifications.
Then I wrote pod 'Firebase/Messaging' in the pod file and install the pods again.
The pod folder contains the folder as Firebase Messaging, but when I import it it says no module found.
You dont need to import FirebaseMessaging
Just add #import Firebase and you will get access to FIRMessaging
I had this issue and I could solve it this way:
if you have a framework that has Firebase/Messaging as it's dependency, and if you have set your framework's build settings to:
Build Active Architecture only
Debug No
Release No
you will get FirebaseMessaging module not found error. just try to make it like this:
Build Active Architecture only
Debug Yes
Release No
Had the same problem. Turns out that you need to place
use_frameworks!
in your Podfile. My Podfile now looks like this:
platform :ios, '8.4'
use_frameworks!
target 'YourTarget' do
pod 'Fabric'
pod 'Crashlytics'
pod 'Bolts'
pod 'Firebase/Core'
pod 'Firebase/Messaging'
# any other Firebase modules you need
end
You don't need to import FirebaseMessaging separately in the latest Firebase SDK according to the latest https://firebase.google.com/docs/cloud-messaging/ios/client:
#import Firebase & just include in your pod file
pod 'Firebase/Messaging'
I hope it will help.
If anything is not working, then you should try
Comment the Firebase and FirebaseMessaging from your Podfile
run pod install
add following to your pod file
pod 'Firebase', '~> 5.4'
pod 'FirebaseMessaging', '~> 3.0'
next is to pod install --repo-update
close your project and open workspace.
when you import the Firebase and try to import FirebaseMessaging, it will show you red marked lines, which means once you import Firebase it already imported the red marked modules in it.
Try it, if it fixes. I have tried and everything is working fine.
Please follow these process :
Clean the Application from product > clean
Close the Application
Again Open workspace of the Application
Again clean.
Hope it will help to you.Thank you.

Error: RNFirebase core module was not found natively on iOS

I created a new app and I am trying to use react-native-firebase. But I continually get this error:
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'.
See http://invertase.link/ios for the ios setup guide.
Steps that I have done:
yarn add react-native-firebase
react-native link react-native-firebase
Set up my .plist file from Google under .../myproject/ios/myproject
Ran pod updateafter ensuring I was using Ruby 2.5.0
Ran pod install
The pod file that I am currently using is:
# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
target 'MyProject' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
pod 'Firebase/Core'
pod 'Firebase/Database'
pod 'Firebase/Messaging'
target 'MyProjectTests' do
inherit! :search_paths
# Pods for testing
end
end
These are the versions that I am using:
"react": "^16.3.0-alpha.1",
"react-native": "0.54.2",
"react-native-firebase": "^3.3.1",
If you don't want to manually link, you can try installing RNFirebase as a pod install directly:
pod 'RNFirebase', :path => 'path/to/node_modules/react-native-firebase/ios'
Changing or hardcoding HEADER_SEARCH_PATHS did not help me. When the error recurs, it's not necessary to rm -rf node_modules nor delete the pod file etc, I found it useful to clear the cache.
I always prefer not to use pods with react native, however, the react-native-firebase's instructions for the non-pop installation will not work.
The reason for this is the package's search paths which assumes either /pods or /firebase
Hence, to make it link properly follow these steps:
download firebase sdk
make a folder directly under ios and call it Firebase, copy the frameworks needed of the sdk in that folder WITHOUT keeping the sub-folders (note, you have not entered XCode yet)
If you haven't already npm install -s react-native-firebase
Open XCode and drag and drop the desired frameworks to the Frameworks-folder in XCode (Eg. in my example the contents of the Analytics, Messaging and DynamicLinks folder). Do not copy items when asked as you already have then in the Firebase subfolder of ios:
In XCode right-click Libraries and select "Add files to [project]". Find RNFirebase-project in node_modules and select the RNFirebase.xcodeproj, do not "copy items"
In Project/Target settings go to Linked Frameworks and Libraries. Find and add libRNFirebase.a
In AppDelegate.m make adjustments as per the instructions from react-native-firebase, eg: import <Firebase.h> and [FIRAPP configure]; in didFinishLaunchingWithOptions
In Header Search Paths AND Framework Search Paths, add $(PROJECT_DIR)/Firebase
Don't forget to add you GoogleServices-Info.plist to your project
I had the same problem, while trying to fix it was making my app to crash on start up.
I moved it through the terminal under the ios/AppFolder/ but the Xcode was never aware of this file.
What helped me was to open my project in Xcode. Then left-click on my AppFolder > Add Files and then add the GoogleService-Info.plist.
I manually linked these react-native-firebase/* packages with
react-native link #react-native-firebase/xxx
"#react-native-firebase/analytics","#react-native-firebase/app","#react-native-firebase/auth","#react-native-firebase/crashlytics","#react-native-firebase/messaging"
which generated pod spec in pod and it worked.

Pods/Headers empty after pod install

Issue
I used to have a functional set of Pods in my project (fully working project) until the latest pod install run, now I'm getting "file not found" errors for the headers mentioned in my bridging header (this is a Swift project with Obj-C includes). After doing some research, it seemed like there should be symlinks to the headers in Pods/Headers, that directory is empty for me. However, the pods themselves have been downloaded and all corresponding Pods/[Lib] directories exist.
Last Known Good State
What I've changed right before this error started occurring was specifying :git and :commit flags for one of the libraries I was pulling in. I then reran pod install and started seeing "file not found" errors. At the time I was using Cocoapods 0.39
Current State
I've tried a few solutions from other stack overflow threads, including adding User Header Search Paths, which had no effect (now back to original), and updating my cocoapods. My current version of cocoapods is now 1.0.0.beta.6. Aside from additional headaches I experienced such as having to rewrite parts of my Podfile to be compliant with new standards, I now seem to be back to the same state (with all libraries successfully downloading, but headers failing to be found).
Here is an example of how I'm including my headers in the bridging header:
// In this header, you should import all the public headers of your framework using statements like #import <MyKit/PublicHeader.h>
#import <CocoaLumberjack/CocoaLumberjack.h>
And here is what my Podfile looks like (I've tried to slim it down to avoid irrelevant content):
source 'https://github.com/CocoaPods/Specs'
platform :ios, '8.0'
use_frameworks!
pod 'CocoaLumberjack', '2.0.0'
pod 'SwiftyJSON', '~> 2.3'
pod 'Classy', :git => 'https://github.com/ClassyKit/Classy.git', :commit => 'c319908f8bded62e268dfd48ee5d65329b819129'
workspace 'my.work-ios'
project 'mywork' # sdk
project 'Examples/example1' # sample project using sdk
project 'my.work-ios.xcodeproj' # placeholder for main project, not really in use
target 'UnitTests' do
pod 'Specta'
pod 'Expecta'
pod 'OCMock'
pod 'OHHTTPStubs'
end
# Copy acknowledgements to the Settings.bundle
post_install do | installer |
require 'fileutils'
pods_acknowledgements_path = 'Pods/Target Support Files/Pods/Pods-Acknowledgements.plist'
settings_bundle_path = Dir.glob("**/*Settings.bundle*").first
if File.file?(pods_acknowledgements_path)
puts 'Copying acknowledgements to Settings.bundle'
FileUtils.cp_r(pods_acknowledgements_path, "#{settings_bundle_path}/Acknowledgements.plist", :remove_destination => true)
end
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['OTHER_SWIFT_FLAGS'] = "-DLEGACY"
end
end
end
Update
After some more digging, I discovered that the culprit is use_frameworks! command, omitting it (and in turn removing Swift libraries, because it's required for them) causes Pods/Headers to be populated with Private and Public directories, along with symlinks for the relevant headers.
This was not the case in previous version of cocoapods, and I'm still trying to understand what's happening, because omitting that command is not a usable workaround for me (given the Swift libraries I use in my app).
Update 2
This is already mentioned in the comments, but for convenience I'm putting this here as well. This seems to be caused by a bug reported in this thread: https://github.com/CocoaPods/CocoaPods/issues/4605#issuecomment-208822149. The thread also suggests a few workarounds that may be good enough for some. For me, they were not, so I went back to 0.39.
Have you tried this settings?
target 'TargetProject' do
pod 'CocoaLumberjack', '2.0.0'
pod 'SwiftyJSON', '~> 2.3'
pod 'Classy', :git => 'https://github.com/ClassyKit/Classy.git', :commit => 'c319908f8bded62e268dfd48ee5d65329b819129'
end
and have this '.swift-version' added? where it contains
'3.0-GM-CANDIDATE'
I'm using this kind of settings for swift 3.0

How to add GitHub's Mantle to Xcode using CocoaPods

I have added GitHub's Mantle project to a iOS 6 project using CocoaPods:
$ pod search Mantle
$ vim Podfile // here I added pod 'Mantle'
$ pod install // this installs Mantle 1.0
Then I have added the ($inherited) variable to the Header Search Paths of project's 'Build Settings' section, before my custom search paths. When importing the Mantle header file Xcode complains with
#import "Mantle.h" // => 'Mantle/MTLJSONAdapter.h' file not found
Am I missing some step? I have other pods installed as well (AFNetworking and SSKeychain) but only Mantle is giving me issues.
I have also added SSToolkit but following the instructions on its 'Getting started', i.e. not using CocoaPods.
Since the problem seemed to be related with the Xcode project/workspace configuration I tried all kind of 'cleaning' solutions:
Delete the Pods directory, the Podfile.lock file and install everything from scratch.
Delete the MyProject.xcworkspace directory and repeat step 1
Enter MyProject.xcodeproj, delete project.xcworkspace and xcuserdata directories and repeat step 1.
Go to the global Xcode directory (/Users/my_user/Library/Developer/Xcode), remove everything related to the project, specially the DerivedData subdirectory, and repeat step 1.
The final step seems to be the final solution, though I cannot tell which file/folder removal did the trick.
Have you added Mantle to your Podfile? You mention running pod install Mantle which doesn't/shouldn't do anything but show an error. ([!] Unrecognized argument:Mantle'`)
After you add Mantle to your Podfile and run pod install you should be able to link Mantle.h directly and there will be a few directories in your xcworkspace and the Pods project. After this you can use #import "Mantle.h" no issues.
I had the same problem, but the problem appears to simply be that my Mantle pod was too old. Changed version to '2.0.5' and pod updated, things work fine.