React-native-firebase: 馃敟Unable to find a specification for `RNFBApp` depended upon by `RNFBCrashlytics`]

Created on 1 Oct 2019  路  10Comments  路  Source: invertase/react-native-firebase


Issue



I'm trying to install Crashlytics but when I run pod intall or pod install --repo-update, I get this error:

[!] Unable to find a specification for `RNFBApp` depended upon by `RNFBCrashlytics`

You have either:
 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.

First I Installed the library following Crashlytics Quick Start ( yarn add @react-native-firebase/crashlytics).

Since I was having the error when running pod install, I decided to follow the steps of the Integrate Into Existing Project section of the website witch brought me to Adding Firebase credentials to your iOS app. After I Added the GoogleService-Info.plist file and updated AppDelegate.m I tried to run pod install but the same error remains.


Project Files






iOS

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.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

target 'ExploraDogs' do

  # Pods for ExploraDogs
  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'

  # react-native-google-signin
  pod 'GoogleSignIn', '~> 4.4.0'

  #  target 'ExploraDogsTests' do
  #   inherit! :search_paths
  #   # Pods for testing
  # end

  use_native_modules!

end

#### `AppDelegate.m`:
/**
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
@import Firebase;
#import "AppDelegate.h"

#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <RNGoogleSignin/RNGoogleSignin.h>
#import <React/RCTLinkingManager.h>

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
  RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
                                                   moduleName:@"ExploraDogs"
                                            initialProperties:nil];

  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];

  if ([FIRApp defaultApp] == nil) {
    [FIRApp configure];
  }

  return YES;
}

- (BOOL)application:(UIApplication *)application 
            openURL:(NSURL *)url 
            options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {

  BOOL facebookHandled = [[FBSDKApplicationDelegate sharedInstance] application:application
    openURL:url
    sourceApplication:options[UIApplicationOpenURLOptionsSourceApplicationKey]
    annotation:options[UIApplicationOpenURLOptionsAnnotationKey]
  ];

  BOOL googleHandled = [RNGoogleSignin application:application openURL:url sourceApplication:options[UIApplicationOpenURLOptionsSourceApplicationKey] annotation:options[UIApplicationOpenURLOptionsAnnotationKey]];

  // Add any custom logic here.
  return facebookHandled || googleHandled;
}

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
  sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
  return [RCTLinkingManager application:application openURL:url
                      sourceApplication:sourceApplication annotation:annotation];
}

- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
  return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
#else
  return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
}

@end


Android

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 -->


Environment

Click To Expand

**`react-native info` output:**

System:
    OS: macOS Mojave 10.14.5
    CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
    Memory: 905.61 MB / 32.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 11.14.0 - /usr/local/bin/node
    Yarn: 1.15.2 - /usr/local/bin/yarn
    npm: 6.9.0 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 13.0, DriverKit 19.0, macOS 10.15, tvOS 13.0, watchOS 6.0
  IDEs:
    Android Studio: 3.2 AI-181.5540.7.32.5056338
    Xcode: 11.0/11A420a - /usr/bin/xcodebuild
  npmPackages:
    react: 16.9.0 => 16.9.0 
    react-native: ^0.61.1 => 0.61.1 
  npmGlobalPackages:
    react-native-cli: 2.0.1
    react-native: 0.59.4
- **Platform that you're experiencing the issue on**: - [ ] iOS - [ ] Android - [x ] **iOS** but have not tested behavior on Android - [ ] **Android** but have not tested behavior on iOS - [ ] Both - **`react-native-firebase` version you're using that has this issue:** - `6.0.0` - **`Firebase` module(s) you're using that has the issue:** - `Crashlytics` - **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]

Most helpful comment

I've no excuses, Really sorry about it. I did not run yarn add @react-native-firebase/app. After I read that the package has been break down into different packages for each library, I thought app * in yarn add @react-native-firebase/app was a place holder for the library I wanted to install. I read the docs again after a good night sleep and I saw I needed to install *@react-native-firebase/app...
Thank you for your time, I hope my silly mistake will help others 馃槃

All 10 comments

At any point in time did you yarn add @react-native-firebase/app ? That should have brought in the app part...

I've no excuses, Really sorry about it. I did not run yarn add @react-native-firebase/app. After I read that the package has been break down into different packages for each library, I thought app * in yarn add @react-native-firebase/app was a place holder for the library I wanted to install. I read the docs again after a good night sleep and I saw I needed to install *@react-native-firebase/app...
Thank you for your time, I hope my silly mistake will help others 馃槃

I never tire of reading success reports or reports of a good nights sleep (what's that?) so no worries. Glad you're working now

Quick question, Everything is working as expected with iOS but I can't build on Android.
Is it possible jitpack has server issues or I did something wrong?
If the pb is on my end I will create a new issue, I just want to make sure not to create an issue if the problem comes from jitpack...
Since i get 522 status code, it should be a jitpack server issue but since I'm not a mobile dev, maybe the gradle is doing stuff under the wood that I'm not aware of...

> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
   > Could not resolve com.crashlytics.sdk.android:crashlytics:2.10.1.
     Required by:
         project :app > project :@react-native-firebase_crashlytics
      > Could not resolve com.crashlytics.sdk.android:crashlytics:2.10.1.
         > Could not get resource 'https://jitpack.io/com/crashlytics/sdk/android/crashlytics/2.10.1/crashlytics-2.10.1.jar'.
            > Could not HEAD 'https://jitpack.io/com/crashlytics/sdk/android/crashlytics/2.10.1/crashlytics-2.10.1.jar'. Received status code 522 from server: Origin Connection Time-out
   > Could not resolve com.crashlytics.sdk.android:crashlytics:2.10.1.
     Required by:
         project :app > project :@react-native-firebase_app > com.google.firebase:firebase-bom:21.1.0
      > Could not resolve com.crashlytics.sdk.android:crashlytics:2.10.1.
         > Could not get resource 'https://jitpack.io/com/crashlytics/sdk/android/crashlytics/2.10.1/crashlytics-2.10.1.jar'.
            > Could not HEAD 'https://jitpack.io/com/crashlytics/sdk/android/crashlytics/2.10.1/crashlytics-2.10.1.jar'. Received status code 522 from server: Origin Connection Time-out

It seems to be a jitpak issue.
Changing maven { url "https://jitpack.io" } to maven { url "https://www.jitpack.io" } fixed the 522 Status Code issue...
After that I was able to download the dependencies but I would get this error:

Execution failed for task ':app:packageDebug'.
> 1 exception was raised by workers:
  java.lang.OutOfMemoryError

To fix this one I just had to add org.gradle.jvmargs=-XX\:MaxHeapSize\=512m -Xmx512m to gradle.properties file.

What a day! ahah

Strange. I have seen that jitpack issue mentioned before but I've hesitated to recommend it. The official react-native template added jitpack even, and they don't use the www, and on the jitpack docs they don't say to use it, so... :thinking:

I have this in my android/app/build.gradle above compileSdkVersion:

// because of firestore:
    dexOptions {
        javaMaxHeapSize "4g"
    }

This is in my gradle.properties:

org.gradle.jvmargs=-Xmx2048M -Dkotlin.daemon.jvm.options\="-Xmx3072M" -XX\:MaxPe
rmSize\=768m -XX\:+HeapDumpOnOutOfMemoryError -Dfile.encoding\=UTF-8
org.gradle.caching=true
org.gradle.parallel=true

Thanks for sharing your config!

Exactly, It felt wrong to me that I had to add the www since react-native template is not configured that way. I will keep an eye on this issue and write something here if there is a better way to overcome this issue.

I get this after I run the above command

Specs satisfying the Firebase/Core (~> 6.3.0), Firebase/Core (~> 6.8.1) dependency were found, but they required a higher minimum deployment target.

Not sure what your deploy target is but react-native doesn't support below iOS9, if you set it to that (my project is) it will work up to pod versions 6.10 for the SDKs, but note you want to have those version locked - they should all be 6.9.x - or whatever the most recent one is before 6.10

Just had the same thing happen with Crashlytics. For those experiencing this, try going into the .podspec for the Pod in question and making sure that the dependency versions you're specifying in your Podfile match those specified in the .podspec. If not, change the versions in the Podfile to match the .podspec. Then run pod install --repo-update

Was this page helpful?
0 / 5 - 0 ratings