invertase / react-native-firebase

🔥 A well-tested feature-rich modular Firebase implementation for React Native. Supports both iOS & Android platforms for all Firebase services.
https://rnfirebase.io
Other
11.64k stars 2.21k forks source link

React native crashlytics not working on ios #6381

Closed Khachik98 closed 2 years ago

Khachik98 commented 2 years ago

I get an error installing "crashlytics" when I run 'pod install' or 'pod install --repo-update'.

Screen Shot 2022-07-11 at 20 35 43

[!] CocoaPods could not find compatible versions for pod "Firebase/CoreOnly": In Podfile: RNFBApp (from ../node_modules/@react-native-firebase/app) was resolved to 15.1.1, which depends on Firebase/CoreOnly (= 9.2.0) None of your spec sources contain a spec satisfying the dependency: Firebase/CoreOnly (= 9.2.0). 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.

My package.json

"@baronha/react-native-multiple-image-picker": "^0.2.9", "@haskkor/react-native-pincode": "^1.22.6", "@miblanchard/react-native-slider": "^2.0.2", "@react-native-community/async-storage": "^1.12.1", "@react-native-community/netinfo": "^6.0.0", "@react-native-community/viewpager": "^5.0.11", "@react-native-firebase/app": "^15.1.1", "@react-native-firebase/crashlytics": "^15.1.1", "@sentry/react-native": "^2.4.0", "babel-plugin-module-resolver": "^4.1.0", "currency-symbol-map": "^5.0.1", "dot-prop-immutable": "^2.1.0", "jetifier": "^2.0.0", "libphonenumber-js": "^1.9.16", "moment": "^2.29.1", "patch-package": "^6.4.7", "postinstall-postinstall": "^2.1.0", "qs": "^6.10.1", "react": "17.0.1", "react-native": "0.64.2", "react-native-branch": "^5.0.0", "react-native-camera": "^3.43.6", "react-native-config": "^1.4.2", "react-native-copilot": "^2.5.1", "react-native-date-picker": "^4.1.0", "react-native-datepicker": "^1.7.2", "react-native-device-info": "^8.1.2", "react-native-fbsdk-next": "^8.0.5", "react-native-floating-action": "^1.21.0", "react-native-get-random-values": "^1.6.0", "react-native-google-places-autocomplete": "^1.3.9", "react-native-heic-converter": "^1.3.0", "react-native-hooks": "^0.9.0", "react-native-htmlview": "^0.16.0", "react-native-iap": "^7.5.1", "react-native-image-picker": "^1.1.0", "react-native-image-zoom-viewer": "^3.0.1", "react-native-keychain": "^7.0.0", "react-native-linear-gradient": "^2.5.4", "react-native-modal": "^11.3.1", "react-native-navigation": "^7.13.0", "react-native-navigation-hooks": "^6.0.2", "react-native-navigation-redux-integration": "^0.3.8", "react-native-pell-rich-editor": "^1.7.0", "react-native-permissions": "^3.0.4", "react-native-phone-input": "^0.2.4", "react-native-progress-circle": "^2.1.0", "react-native-safe-area-context": "^3.2.0", "react-native-safe-area-view": "1.0.0", "react-native-svg": "^12.1.0", "react-native-swipe-item": "^0.6.0", "react-native-text-input-mask": "^3.1.4", "react-native-touch-id": "^4.4.1", "react-native-view-pdf": "^0.10.1", "react-native-webview": "7.0.7", "react-native-youtube-iframe": "^2.2.2", "react-redux": "^7.2.3", "recompose": "^0.30.0", "redux": "^4.0.4", "redux-form": "^8.2.4", "redux-immutable-state-invariant": "^2.1.0", "redux-logger": "^3.0.6", "redux-saga": "^1.0.5", "redux-saga-testing": "^1.0.5", "rn-fetch-blob": "^0.12.0", "typescript": "^4.2.4", "typescript-fsa": "^3.0.0-beta-2"

My Podfile

platform :ios, '15.0' pod 'Permission-PhotoLibrary', :path => "#{permissions_path}/PhotoLibrary" pod 'Firebase/Analytics' pod 'Firebase/Core', '~> 6.13.0' pod 'Firebase/Messaging', '~> 6.13.0' pod 'GoogleIDFASupport', '~> 3.14.0' pod 'react-native-branch', :path => '../node_modules/react-native-branch' pod 'RNFBApp', :path => '../node_modules/@react-native-firebase/app' pod 'RNFBCrashlytics', :path => '../node_modules/@react-native-firebase/crashlytics'

My AppDelegate.m

import

(BOOL)application:(UIApplication )application didFinishLaunchingWithOptions:(NSDictionary )launchOptions { [FIRApp configure]; return YES; }

Xcode Version 12.0

mikehardy commented 2 years ago

Your podfile looks extremely suspect, I don't think this is supportable in any way:


pod 'Firebase/Analytics'
pod 'Firebase/Core', '> 6.13.0'
pod 'Firebase/Messaging', '> 6.13.0'
pod 'GoogleIDFASupport', '~> 3.14.0'
pod 'react-native-branch', :path => '../node_modules/react-native-branch'
pod 'RNFBApp', :path => '../node_modules/@react-native-firebase/app'
pod 'RNFBCrashlytics', :path => '../node_modules/@react-native-firebase/crashlytics'

First, you are bringing in concrete versions of firebase modules. You must not do that. @react-native-firebase/app controls the versions and if you need to override them you do so according to the documentation: https://rnfirebase.io/#ios

So you will remove the top 4 lines I quote.

We use auto-linking and do not support manual linking really, you are on your own if doing that as it indicates some deep project integration failures which make support impossible. So you should remove the last two lines I quote.

Here's a script that shows a proper integration starting from scratch: https://github.com/mikehardy/rnfbdemo/blob/main/make-demo.sh

Once you've removed at least the concrete versions for modules that should never be included in the Podfile, you will stop having Pod version mismatch issues

Khachik98 commented 2 years ago

Your podfile looks extremely suspect, I don't think this is supportable in any way:

pod 'Firebase/Analytics'
pod 'Firebase/Core', '> 6.13.0'
pod 'Firebase/Messaging', '> 6.13.0'
pod 'GoogleIDFASupport', '~> 3.14.0'
pod 'react-native-branch', :path => '../node_modules/react-native-branch'
pod 'RNFBApp', :path => '../node_modules/@react-native-firebase/app'
pod 'RNFBCrashlytics', :path => '../node_modules/@react-native-firebase/crashlytics'

First, you are bringing in concrete versions of firebase modules. You must not do that. @react-native-firebase/app controls the versions and if you need to override them you do so according to the documentation: https://rnfirebase.io/#ios

So you will remove the top 4 lines I quote.

We use auto-linking and do not support manual linking really, you are on your own if doing that as it indicates some deep project integration failures which make support impossible. So you should remove the last two lines I quote.

Here's a script that shows a proper integration starting from scratch: https://github.com/mikehardy/rnfbdemo/blob/main/make-demo.sh

Once you've removed at least the concrete versions for modules that should never be included in the Podfile, you will stop having Pod version mismatch issues

After removing these lines when I run 'pod install' I get this error.

Screen Shot 2022-07-12 at 10 15 18

[!] The following Swift pods cannot yet be integrated as static libraries: The Swift pod FirebaseCoreInternal depends upon GoogleUtilities, which does not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries), you may set use_modular_headers! globally in your Podfile, or specify :modular_headers => true for particular dependencies.

Podfile.lock is deleted from me

mikehardy commented 2 years ago

Interesting - now I think I see why people attempting to use react-native-firebase v15 are adding use_modular_headers everywhere, that has really been confusing to me. It's not in our guides anywhere but I'm starting to see Podfiles with that stuff scattered all over it.

As near as I can tell hermes and Flipper are still not working with use_frameworks, so those are out.

My make-demo script still works for me (with react-native 0.69.0 - I still need to update it) and though I have hermes in there for release versions you either need to disable bitcode or disable hermes (I recommend disabling bitcode), but it works, there are no pod install failures I'm aware of