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.66k stars 2.21k forks source link

framework not found FirebaseFirestoreInternal when run my react native iOS appllication.i need install react-native firebase/firestore #7463

Closed FazilMuhammed closed 10 months ago

FazilMuhammed commented 10 months ago

Issue

Describe your issue here


Project Files

Javascript

Click To Expand

#### `package.json`: ```json # N/A ``` #### `firebase.json` for react-native-firebase v6: ```json # N/A ```

iOS

Click To Expand

#### `ios/Podfile`: - [ ] I'm not using Pods - [x] I'm using Pods and my Podfile looks like: ```ruby # N/A ``` #### `AppDelegate.m`: ```objc // N/A ```


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`: ```groovy // N/A ``` #### `android/app/build.gradle`: ```groovy // N/A ``` #### `android/settings.gradle`: ```groovy // N/A ``` #### `MainApplication.java`: ```java // N/A ``` #### `AndroidManifest.xml`: ```xml ```


Environment

Click To Expand

**`react-native info` output:** ``` OUTPUT GOES HERE ``` - **Platform that you're experiencing the issue on**: - [ ] iOS - [ ] Android - [ ] **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:** - `e.g. 5.4.3` - **`Firebase` module(s) you're using that has the issue:** - `e.g. Instance ID` - **Are you using `TypeScript`?** - `Y/N` & `VERSION`


mikehardy commented 10 months ago

You have skipped the important parts of the template so it is not possible to help and I will close this.

I will say that when people post about this problem they usually have some sort of modular_headers stuff in their Podfile in an attempt to avoid use_frameworks! :linkage => :static

I can say that no support is offered for those workarounds because they lead to problems like this.

If you follow our install documentation at https://rnfirebase.io and enable iOS use_frameworks with static linkage, firestore should work.

FazilMuhammed commented 10 months ago

@mikehardy can you share how look like the cocopods page inside iOS folder 0.72.5.when I create new project its look like this

require Pod::Executable.execute_command('node', ['-p',
  'require.resolve(
    "react-native/scripts/react_native_pods.rb",
    {paths: [process.argv[1]]},
  )', __dir__]).strip

platform :ios, min_ios_version_supported
prepare_react_native_project!

flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabled

linkage = ENV['USE_FRAMEWORKS']
if linkage != nil
  Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
  use_frameworks! :linkage => linkage.to_sym
end

target 'abcd' do
  config = use_native_modules!

  flags = get_default_flags()

  use_react_native!(
    :path => config[:reactNativePath],
    :hermes_enabled => flags[:hermes_enabled],
    :fabric_enabled => flags[:fabric_enabled],
    :flipper_configuration => flipper_config,
    :app_path => "#{Pod::Config.instance.installation_root}/.."
  )

  post_install do |installer|
    react_native_post_install(
      installer,
      config[:reactNativePath],
      :mac_catalyst_enabled => false
    )
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
  end
end

I used use_frameworks! :linkage => :static but getting my application completely and more more errors finally I failed to install react-native-firebase/firestore

MinatoFanboy commented 10 months ago

I also got the same error. just a few days when i cloned the project from github and reinstalled everything and got the error

MinatoFanboy commented 10 months ago

I also got the same error. just a few days when i cloned the project from github and reinstalled everything and got the error

I have solved this issue

mikehardy commented 10 months ago

@FazilMuhammed try this: https://github.com/mikehardy/rnfbdemo/blob/main/make-demo.sh

Additionally,

I used use_frameworks! :linkage => :static but getting my application completely and more more errors

Without any detail surrounding the assertion of "more errors" it is not possible to reason about them. It sounds like you are using other modules (perhaps Flipper is not disabled despite being directed to do so in our docs? Perhaps some other module is not compatible with use_frameworks and you need to raise an issue with them?) that don't work with use_frameworks

mikehardy commented 10 months ago

@FazilMuhammed I can say on review of the Podfile that without knowing what your $ENV looks like (it must have the correct flipper / frameworks settings - but it's easier to not rely on ENV and just hard code them) that you are not installed correctly. You are missing the $RNFirebaseAsStaticFramework = true which is clearly documented on https://rnfirebase.io/

It will not be possible for you to install + build react-native-firebase unless you follow the documentation and do as it requires

carlidev662 commented 3 months ago

Hi, I read this and other articles and I'm having problems integrating Firebase Firestore and Storage. I read the documentation, however the app doesn't run on iOS. I read different articles, including quite a few on Storage to see if that's how it worked for me, but I still can't get it to stand up. the instructions shown in the documentation I don't know if the version of my react or xcode could be the problem este es mi podfile

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, min_ios_version_supported
prepare_react_native_project!

flipper_config = FlipperConfiguration.disabled

linkage = ENV['USE_FRAMEWORKS']
if linkage != nil
  Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
  use_frameworks! :linkage => :static
  $RNFirebaseAsStaticFramework = true
end

permissions_path = '../node_modules/react-native-permissions/ios'

target 'AppReact' do
  use_modular_headers!
  config = use_native_modules!
  pod 'GoogleMaps', '~> 6.0.0'
  pod 'abseil'
  pod 'gRPC'
  pod 'gRPC-C++'
  pod 'gRPC-ProtoRPC'
  pod 'gRPC-RxLibrary'
  pod 'Firebase/Core'

  pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec', :modular_headers => false

  pod 'react-native-image-picker', :path => '../node_modules/react-native-image-picker'
  pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
  pod 'react-native-maps', :path => '../node_modules/react-native-maps'

  pod 'Permission-LocationWhenInUse', :path => "#{permissions_path}/LocationWhenInUse.podspec"
  pod 'Permission-Camera', :path => "#{permissions_path}/Camera.podspec"
  pod 'Permission-LocationAlways', :path => "#{permissions_path}/LocationAlways.podspec"

  pod 'RNFBApp', :path => '../node_modules/@react-native-firebase/app', :modular_headers => true
  #pod 'RNFBStorage', :path => '../node_modules/@react-native-firebase/storage', :modular_headers => true
  pod 'RNFBFirestore', :path => '../node_modules/@react-native-firebase/firestore', :modular_headers => true

  # Flags change depending on the env values.
  flags = get_default_flags()

  use_react_native!(
    :path => config[:reactNativePath],
    :hermes_enabled => flags[:hermes_enabled],
    :fabric_enabled => flags[:fabric_enabled],
    :flipper_configuration => flipper_config,
    # An absolute path to your application root.
    :app_path => "#{Pod::Config.instance.installation_root}/.."
  )

  target 'AppReactTests' do
    inherit! :complete
    # Pods for testing
  end

  post_install do |installer|
    react_native_post_install(
      installer,
      # Set `mac_catalyst_enabled` to `true` in order to apply patches
      # necessary for Mac Catalyst builds
      :mac_catalyst_enabled => false
    )
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
  end
end

`equire_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, min_ios_version_supported
prepare_react_native_project!

flipper_config = FlipperConfiguration.disabled

linkage = ENV['USE_FRAMEWORKS']
if linkage != nil
  Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
  use_frameworks! :linkage => :static
  $RNFirebaseAsStaticFramework = true
end

permissions_path = '../node_modules/react-native-permissions/ios'

target 'AppReact' do
  use_modular_headers!
  config = use_native_modules!
  pod 'GoogleMaps', '~> 6.0.0'
  pod 'abseil'
  pod 'gRPC'
  pod 'gRPC-C++'
  pod 'gRPC-ProtoRPC'
  pod 'gRPC-RxLibrary'
  pod 'Firebase/Core'

  pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec', :modular_headers => false

  pod 'react-native-image-picker', :path => '../node_modules/react-native-image-picker'
  pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
  pod 'react-native-maps', :path => '../node_modules/react-native-maps'

  pod 'Permission-LocationWhenInUse', :path => "#{permissions_path}/LocationWhenInUse.podspec"
  pod 'Permission-Camera', :path => "#{permissions_path}/Camera.podspec"
  pod 'Permission-LocationAlways', :path => "#{permissions_path}/LocationAlways.podspec"

  pod 'RNFBApp', :path => '../node_modules/@react-native-firebase/app', :modular_headers => true
  #pod 'RNFBStorage', :path => '../node_modules/@react-native-firebase/storage', :modular_headers => true
  pod 'RNFBFirestore', :path => '../node_modules/@react-native-firebase/firestore', :modular_headers => true

  # Flags change depending on the env values.
  flags = get_default_flags()

  use_react_native!(
    :path => config[:reactNativePath],
    :hermes_enabled => flags[:hermes_enabled],
    :fabric_enabled => flags[:fabric_enabled],
    :flipper_configuration => flipper_config,
    # An absolute path to your application root.
    :app_path => "#{Pod::Config.instance.installation_root}/.."
  )

  target 'AppReactTests' do
    inherit! :complete
    # Pods for testing
  end

  post_install do |installer|
    react_native_post_install(
      installer,
      # Set `mac_catalyst_enabled` to `true` in order to apply patches
      # necessary for Mac Catalyst builds
      :mac_catalyst_enabled => false
    )
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
  end
end

I have moserrat 12.7.5 and xcode 12.0 and it does not allow me to upload my OS anymore and that is why I created the project with a lower version of react-native to be able to install the emulator on iOS

package.json

{
  "name": "AppReact",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "lint": "eslint .",
    "start": "react-native start",
    "test": "jest"
  },
  "dependencies": {
    "@react-native-async-storage/async-storage": "^1.23.1",
    "@react-native-community/geolocation": "^3.2.1",
    "@react-native-firebase/app": "^20.1.0",
    "@react-native-firebase/firestore": "^20.1.0",
    "@react-navigation/bottom-tabs": "^6.5.20",
    "@react-navigation/native": "^6.1.17",
    "@react-navigation/native-stack": "^6.9.26",
    "@reduxjs/toolkit": "^2.2.5",
    "@types/lodash": "^4.17.5",
    "@types/react-native-vector-icons": "^6.4.18",
    "lodash": "^4.17.21",
    "native-base": "^3.4.28",
    "react": "18.2.0",
    "react-native": "0.71.6",
    "react-native-fast-image": "^8.6.3",
    "react-native-image-picker": "^7.1.2",
    "react-native-maps": "1.3.2",
    "react-native-paper": "^5.12.3",
    "react-native-paper-dropdown": "^1.0.7",
    "react-native-permissions": "2.2.0",
    "react-native-safe-area-context": "3.3.2",
    "react-native-screens": "^3.31.1",
    "react-native-svg": "12.1.1",
    "react-native-vector-icons": "^10.1.0",
    "react-redux": "^9.1.2",
    "redux-persist": "^6.0.0"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "@babel/preset-env": "^7.20.0",
    "@babel/runtime": "^7.20.0",
    "@react-native-community/eslint-config": "^3.2.0",
    "@tsconfig/react-native": "^2.0.2",
    "@types/jest": "^29.2.1",
    "@types/react": "^18.0.24",
    "@types/react-test-renderer": "^18.0.0",
    "@typescript-eslint/eslint-plugin": "^7.13.0",
    "@typescript-eslint/parser": "^7.13.0",
    "babel-jest": "^29.2.1",
    "eslint": "^8.57.0",
    "eslint-config-prettier": "^9.1.0",
    "eslint-plugin-prettier": "^5.1.3",
    "eslint-plugin-react": "^7.34.2",
    "eslint-plugin-react-native": "^4.1.0",
    "jest": "^29.2.1",
    "metro-react-native-babel-preset": "0.73.9",
    "prettier": "^2.8.8",
    "react-test-renderer": "18.2.0",
    "typescript": "4.8.4"
  },
  "jest": {
    "preset": "react-native"
  },
  "packageManager": "yarn@3.6.4"
}

` I thank you in advance for any help if you can see I put the :modular_headers => true because it told me in one part to put it but in the documentation it is not like that so I tried it without that but it doesn't work for me