So I'm trying to install RN Firebase Cloud Messaging and I'm getting the following error from Cocoapods.
I simply ran the following yarn add @react-native-firebase/messaging
to install the messaging package, but got the below error.
NB: I already have @react-native-firebase/app installed, have remote config already working within the project.
```
[!] CocoaPods could not find compatible versions for pod "Firebase/Messaging":
In Podfile:
RNFBMessaging (from
../node_modules/@react-native-firebase/messaging`) was resolved to 6.0.0, which depends on
Firebase/Messaging (~> 6.8.1)
Specs satisfying the Firebase/Messaging (~> 6.8.1)
dependency were found, but they required a higher minimum deployment target.
````
Click To Expand
#### `ios/Podfile`: - [ ] I'm not using Pods - [x] I'm using Pods and my Podfile looks like:
# Uncomment the next line to define a global platform for your project
platform :ios, '9'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
target 'MobileApp' do
pod 'React', :path => '../node_modules/react-native/'
pod 'React-Core', :path => '../node_modules/react-native/React'
pod 'React-DevSupport', :path => '../node_modules/react-native/React'
pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
pod 'React-RCTWebSocket', :path => '../node_modules/react-native/Libraries/WebSocket'
pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
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'
use_native_modules!
end
#### `AppDelegate.m`:
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import "AppDelegate.h"
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <BugsnagReactNative/BugsnagReactNative.h>
#import "RCTLinkingManager.h"
#import <Firebase.h>
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[FIRApp configure];
NSURL *jsCodeLocation;
[BugsnagReactNative start];
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
// jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
moduleName:@"MobileApp"
initialProperties:nil
launchOptions:launchOptions];
rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
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 *)application openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
return [RCTLinkingManager application:application openURL:url
sourceApplication:sourceApplication annotation:annotation];
}
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity
restorationHandler:(void (^)(NSArray * _Nullable))restorationHandler
{
return [RCTLinkingManager application:application
continueUserActivity:userActivity
restorationHandler:restorationHandler];
}
@end
Click To Expand
#### Have you converted to AndroidX? - [ ] my application is an AndroidX application? - [ ] I am using `android/gradle.settings` `jetifier=true` for Android compatibility? - [ ] I am using the NPM package `jetifier` for react-native compatibility? #### `android/build.gradle`:
// N/A
#### `android/app/build.gradle`:
// N/A
#### `android/settings.gradle`:
// N/A
#### `MainApplication.java`:
// N/A
#### `AndroidManifest.xml`:
<!-- N/A -->
Click To Expand
**`react-native info` output:**
System:
OS: macOS 10.14.5
CPU: (4) x64 Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
Memory: 98.66 MB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 8.11.3 - /usr/local/bin/node
Yarn: 1.17.3 - /usr/local/bin/yarn
npm: 6.11.3 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
Android SDK:
API Levels: 23, 24, 25, 26, 27, 28
Build Tools: 23.0.1, 23.0.3, 24.0.1, 25.0.2, 25.0.3, 26.0.1, 26.0.2, 26.0.3, 27.0.0, 27.0.3, 28.0.0, 28.0.3
System Images: android-23 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom_64
IDEs:
Android Studio: 3.1 AI-173.4819257
Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
react: 16.8.6 => 16.8.6
react-native: 0.60.5 => 0.60.5
npmGlobalPackages:
react-native-cli: 2.0.1
- **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
- **`@react-native-firebase/app` version you're using that has this issue:**
- `e.g. 0.4.3`
- **`Firebase` module(s) you're using that has the issue:**
- `Cloud Messaging`
- **Are you using `TypeScript`?**
- `N`
Think react-native-firebase
is great? Please consider supporting all of the project maintainers and contributors by donating via our Open Collective where all contributors can submit expenses. [Learn More]
React Native Firebase
and Invertase
on Twitter for updates on the library.This should be in a FAQ or similar - it has bitten a couple people and will block you fully if not resolved
Root cause is your podspecs are out of date.
In my case doing a pod repo update
syncs the podspecs and then version 6.8.1 (which is just a week or so old, explaining why you're likely getting caught by it) should be found. A pod install --repo-update
should also be adequate but I have a co-worker that doesn't work for, for some reason.
Someone else had to get more forcible with the update (going into $HOME/.cocoapods and using git directly I think?) but it is the same underlying cause.
I'm closing this because I'm 99.99% sure this is the reason but please do reopen if it doesn't resolve for you
i had same issue
pod update
and pod repo update
did not help at all !
But this works? https://github.com/mikehardy/rnfbdemo/blob/master/make-demo.sh
i had same issue
pod update
andpod repo update
did not help at all !
Were you able to solve it @sultan-arshi ?
please see if your pod file ios version is not lower then minimum for fire base
i think minimum version for firebase is 10 (not 100% sure, you can confirm it)
it is not so much "minimum" as just staying current as we track upstream bug fixes and ingest bug fixes here
Current here is v10.3.1 which implies firebase-ios-sdk 7.3.0 and firebase-android-sdk 26.2.0
Oh! I misunderstood Sultan-arshi - he is right about ios minimum deployment version in the Podfiles, those are 10 now
Most helpful comment
This should be in a FAQ or similar - it has bitten a couple people and will block you fully if not resolved
Root cause is your podspecs are out of date.
In my case doing a
pod repo update
syncs the podspecs and then version 6.8.1 (which is just a week or so old, explaining why you're likely getting caught by it) should be found. Apod install --repo-update
should also be adequate but I have a co-worker that doesn't work for, for some reason.Someone else had to get more forcible with the update (going into $HOME/.cocoapods and using git directly I think?) but it is the same underlying cause.
I'm closing this because I'm 99.99% sure this is the reason but please do reopen if it doesn't resolve for you