React-native-firebase: firebase module that's not installed natively on your iOS project by calling firebase.crashlytics()

Created on 2 Apr 2019  路  17Comments  路  Source: invertase/react-native-firebase


Issue


You attempted to use a firebase module that's not installed natively on your iOS project by calling firebase.crashlytics()

here is screenshot
Simulator Screen Shot - iPhone X - 2019-04-02 at 15 09 41

I Upgrade Rn to 0.59.2 and pretty sure I have crashlytics and fabric on my profile

  pod 'Crashlytics', '~> 3.12.0'
  pod 'Fabric', '~> 1.9.0'



Project Files






iOS

ios/Podfile:

  • [ ] I'm not using Pods
  • [x] I'm using Pods and my Podfile looks like:
# N/A

AppDelegate.m:

// N/A

Android

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

  • 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

  • If known, the version of the platform are you experiencing the issue on:

    • ADD_SOMETHING_HERE e.g. iOS 10 or Android API 28

  • Operating System:

    • [x ] MacOS, version: N/A

    • [ ] Windows, version: N/A

    • [ ] Other, please specify: N/A

  • Build Tools:

    • ADD_SOMETHING_HERE e.g. Xcode 10, Android Studio 3.2

  • React Native version:

    • ADD_SOMETHING_HERE

  • React Native Firebase library version:

    • ADD_SOMETHING_HERE

  • Firebase module(s) you're using that has the issue:

    • [x] N/A

    • [ ] Authentication

    • [ ] Analytics

    • [ ] Cloud Firestore

    • [ ] Cloud Messaging (FCM)

    • [x] Crashlytics

    • [ ] Dynamic Links

    • [ ] Functions Callable

    • [ ] In App Messaging

    • [ ] Indexing

    • [ ] Invites

    • [ ] Instance ID

    • [ ] ML Kit

    • [ ] Notifications

    • [ ] Performance Monitoring

    • [ ] Realtime Database

    • [ ] Remote Config

    • [ ] Storage

  • Are you using TypeScript?

    • [ ] No

    • [ ] Yes, version: N/A

  • Are you using Expo, e.g. ExpoKit?

    • [x] No

    • [ ] Yes, I've _not_ ejected

    • [ ] Yes, but I have ejected to ExpoKit

    • [ ] Yes, but I have ejected to vanilla React Native

    • Expo version: N/A




Think react-native-firebase is great? Please consider supporting the project with any of the below:

Build Error Stale

Most helpful comment

I fixed it by downgrading my pod version and then reinstalling everything.
Thanks,

All 17 comments

That's a clear install failure

but you didn't include your Podfile :thinking: :man_shrugging:

Make sure your podfile is correct.
pod update
make sure you open the workspace not the project
clean the build folder
close and reopen xcode

I struggle with the same issue most of the day. I have a project where RN-firebase was already installed successfully with CocoaPod (only Analytics) and I try to add Crashlytics without success :-(

My Podfile:

# Uncomment the next line to define a global platform for your project
platform :ios, '9.1'

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

  pod 'React', :path => '../node_modules/react-native', :subspecs => [
    'Core',
    'CxxBridge',
    'DevSupport',
    'RCTActionSheet',
    'RCTAnimation',
    'RCTBlob',
    # 'RCTGeolocation',
    'RCTImage',
    'RCTLinkingIOS',
    'RCTNetwork',
    'RCTPushNotification',
    'RCTSettings',
    'RCTText',
    'RCTVibration',
    'RCTWebSocket',
  ]

  # Explicitly include Yoga if you are using RN >= 0.42.0
  pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

  # Third party deps podspec link
  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'


  # Required by RNFirebase v5 Crashlytics
  pod 'Fabric', '~> 1.9.0'
  pod 'Crashlytics', '~> 3.12.0'

  # Required by RNFirebase
  pod 'Firebase/Core', '~> 5.15.0'

  # Pods for Smyler
  pod 'Firebase/Messaging'

  pod 'GoogleSignIn'

  pod 'react-native-fcm', :path => '../node_modules/react-native-fcm'
  pod 'react-native-image-picker', :path => '../node_modules/react-native-image-picker'
  pod 'react-native-image-resizer', :path => '../node_modules/react-native-image-resizer'
  pod 'react-native-spinkit', :path => '../node_modules/react-native-spinkit'
  pod 'SentryReactNative', :path => '../node_modules/react-native-sentry/SentryReactNative.podspec'
  pod 'react-native-splash-screen', :path => '../node_modules/react-native-splash-screen'
  pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
  pod 'RNDeviceInfo', :path => '../node_modules/react-native-device-info'
  pod 'react-native-add-calendar-event', :path => '../node_modules/react-native-add-calendar-event'
  pod 'react-native-webview', :path => '../node_modules/react-native-webview'
  pod 'RNGoogleSignin', :path => '../node_modules/react-native-google-signin'
  pod 'RNSound', :path => '../node_modules/react-native-sound'
  pod 'rn-fetch-blob', :path => '../node_modules/rn-fetch-blob'
  pod 'react-native-pdf', :path => '../node_modules/react-native-pdf'
  pod 'react-native-config', :path => '../node_modules/react-native-config'
  pod 'RNShare', :path => '../node_modules/react-native-share'
  pod 'react-native-cookies', :path => '../node_modules/react-native-cookies/ios/react-native-cookies.podspec'
  pod 'RNFirebase', :path => '../node_modules/react-native-firebase/ios/RNFirebase.podspec'

end


post_install do |installer|

  # Fix for react-native-config script
  # https://github.com/luggit/react-native-config/issues/125#issuecomment-350119869
  installer.pods_project.targets.each do |target|
    if target.name == 'react-native-config'
      phase = target.project.new(Xcodeproj::Project::Object::PBXShellScriptBuildPhase)
      phase.shell_script = "cd ../../"\
                           " && RNC_ROOT=./node_modules/react-native-config/"\
                           " && export SYMROOT=$RNC_ROOT/ios/ReactNativeConfig"\
                           " && export BUILD_DIR=$RNC_ROOT/ios/ReactNativeConfig"\
                           " && ruby $RNC_ROOT/ios/ReactNativeConfig/BuildDotenvConfig.ruby"

      target.build_phases << phase
      target.build_phases.move(phase,0)
    end
  end

end
    "react-native": "0.59.0",
    "react-native-firebase": "^5.2.3",

I did a pod update, clean project, restart Xcode several times without success.

It seems that in node_modules/react-native-firebase/ios/RNFirebase/fabric/crashlytics/RNFirebaseCrashlytics.m neither <Crashlytics/Crashlytics/Crashlytics.h> or <Crashlytics/Crashlytics.h> are valid (I tested by commenting each if).

I try to import and use <Crashlytics/Crashlytics.h> in AppDelegate.m and it works.

I enable Firebase debug with -FIRDebugEnabled and I can see that Crashlytics is properly configured.

I don't have enough knowledge of Xcode/iOS build system to investigate further.

Note: Crashlytics seems to actually works fine on iOS, aka my crashes are reported. It is just that we cannot call RN-firebase JS functions because the module isn't registered.

Hi all!

I have a project that was working since 2 days ago (same day that this issue was opened). I started getting this issue without any change did in the project. All versions are the same in package.json and podfile:

react-native-firebase: 4.3.8
installed pods:

PODS:
  - Crashlytics (3.10.9):
    - Fabric (~> 1.7.13)
...
DEPENDENCIES:
  - Crashlytics (~> 3.10.7)
  - Fabric (~> 1.7.13)
...

Anyone have any idea about that?

since 2 days ago sounds suspiciously like xcode updated and you did a pod update or similar. did you have your podfile.lock committed and was that used via pod install or was it a pod update? there may still have been variance in your builds in other words either in the actually installed pods or the toolchain (XCode update - it broke some other modules I've got)

These problems are tricky enough to reproduce that a sample project demonstrating the issue (with complete podfile, package-lock.json, podfile-lock etc) might be necessary to reproduce it. I can't diagnose more by just thinking more, I'd need to see it

I'm getting the same error. Installed everything according to the docs.

react-native-firebase: 5.2.1
react-native: 0.57.8

Podfile:

platform :ios, '10.3'
inhibit_all_warnings!
workspace 'MyApp.xcworkspace'

target 'MyApp' do
    pod 'Bolts'
    pod 'FBSDKCoreKit', '= 4.38.1'
    pod 'FBSDKLoginKit', '= 4.38.1'
    pod 'Firebase/Core', :modular_headers => true
    pod 'Firebase/Analytics', :modular_headers => true
    pod 'Fabric', '~> 1.9.0'
    pod 'Crashlytics', '~> 3.12.0'
end

JS code:

import firebase from 'react-native-firebase';

...

componentDidMount() {
    firebase.crashlytics().crash();
}

Error:

Error: You attempted to use a firebase module that's not installed natively on your iOS project by calling firebase.crashlytics().
Crashlytics@http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:170852:108

Screen Shot 2019-04-08 at 09 12 16

Same with:

 pod 'Firebase/Core', '~> 5.3.0'
  pod 'Firebase/Auth', '~> 5.3.0'
  pod 'Firebase/Database', '~> 5.3.0'
  pod 'Firebase/Messaging', '~> 5.3.0'

  pod 'Fabric', '~> 1.7.13'
  pod 'Crashlytics', '~> 3.10.7'

And

    "react": "16.4.1",
    "react-native": "0.56.0",
   "react-native-firebase": "4.3.8",

And with:

pod 'Fabric', '~> 1.7.5'
pod 'Crashlytics', '~> 3.10.4'

Same with manual Fabric + Crashlytics installation (not using Pods)

+1 same issue

These are very configuration dependent - we need a reproduction scenario. Has anyone attempted to use crashlytics API calls in the start app https://github.com/invertase/react-native-firebase-starter ?

I have current versions of everything, I have crashlytics successfully integrated and it is reporting crashes correctly, as mentioned above,but I am not actually calling the JS APIs so I can't confirm this problem or not unfortunately.

@shubhamverma27 simply me-tooing is not useful, just use a reaction etc to be counted as a vote. Better, try pulling the starter and using Crashlytics there as you are trying in your app, then we will have a reproduction and can fix

I fixed it by downgrading my pod version and then reinstalling everything.
Thanks,

Solved this by removing

pod 'RNFirebase', :path => '../node_modules/react-native-firebase/ios/RNFirebase.podspec'

on my PodFile and automaticly link the rnfirebase by

react-native link react-native-firebase

there no more error for me and crashlytics is working
````
import firebase from 'react-native-firebase';

...

componentDidMount() {
firebase.crashlytics().crash();
}
````

Hello 馃憢, to help manage issues we automatically close stale issues.
This issue has been automatically marked as stale because it has not had activity for quite some time. Has this issue been fixed, or does it still require the community's attention?

This issue will be closed in 15 days if no further activity occurs.
Thank you for your contributions.

I have experienced the same problem with version 5.4.0 of react-native-firebase.. It still happens after upgrading to 5.4.1

Also tried with different versions of Cocoapods, but it seems to make no difference.. Tried 1.5.3, 1.6.1 and 1.7.0

Only solution for now was to statically link libRNFirebase.a as specified by @maxto024

Worst thing is that even if you don't specifically use firebase.crashlytics() it still crashed on initialization on release builds (seems to silently fail when debugging on device)

I believe the recommendation you followed is just following the recommended path in the docs. For react-native-firebase 5.x.x you should use Pods for the firebase SDKs, but you should react-native link the react-native-firebase library itself. On the other hand @Salakar I'm only tagging you because this is the same error given during ios e2e tests on local machines. Smells suspicious and is just something for the back of the mind to think about

@shubhamverma27 can you please explain which version exactly did you downgrade? from which to which?

In my case I got the same message but for Auth module. To solve it, I had to add each module in the Podfile, didn't know if it's the normal process or not, I followed the tutorial on this website (https://rnfirebase.io/docs/v5.x.x/installation/ios), and only added "Firebase/Core"

pod 'Firebase/Core', '~> 6.11.0'
pod 'Firebase/Auth', '~> 6.11.0'
pod 'Firebase/Messaging', '~> 6.11.0'
pod 'RNFirebase', :path => '../node_modules/react-native-firebase/ios'
Was this page helpful?
0 / 5 - 0 ratings