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.71k stars 2.22k forks source link

🔥 'FirebaseStorage/FirebaseStorage-Swift.h' file not found #7535

Closed moatasemyakhni closed 10 months ago

moatasemyakhni commented 10 months ago

Issue

Describe your issue here failed build if I only add the packages and I type cd ios && pod install, the build fail with this error

'FirebaseStorage/FirebaseStorage-Swift.h' file not found

The docs are mentioning to use use_frameworks! :linkage => :static $RNFirebaseAsStaticFramework = true However, this is causing the following error

'react/debug/react_native_assert.h' file not found

I read, also, that " use_frameworks! :linkage => :static " is discouraged. However, I have used it and caused other problems like the problem above.


Project Files

Javascript

Click To Expand

#### `package.json`: ```json { "name": "test", "version": "0.0.1", "private": true, "scripts": { "android": "npx react-native run-android", "ios": "npx react-native run-ios", "lint": "eslint .", "start": "npx react-native start --reset-cache", "test": "jest", }, "dependencies": { "@react-native-async-storage/async-storage": "^1.19.3", "@react-native-clipboard/clipboard": "^1.12.1", "@react-native-community/checkbox": "^0.5.16", "@react-native-community/netinfo": "^9.4.1", "@react-native-firebase/app": "^18.7.3", "@react-native-firebase/storage": "^18.7.3", "@react-navigation/bottom-tabs": "^6.5.8", "@react-navigation/native": "^6.1.7", "@react-navigation/native-stack": "^6.9.13", "@reduxjs/toolkit": "^1.9.5", "js-validations-form-localized": "^1.0.4", "lodash.debounce": "^4.0.8", "react": "18.2.0", "react-native": "0.73.1", "react-native-chart-kit": "^6.12.0", "react-native-date-picker": "^4.3.3", "react-native-encrypted-storage": "^4.0.3", "react-native-geolocation-service": "^5.3.1", "react-native-gesture-handler": "^2.14.0", "react-native-localization": "^2.3.2", "react-native-localize": "^3.0.2", "react-native-maps": "^1.8.4", "react-native-modal": "^13.0.1", "react-native-permissions": "^3.10.1", "react-native-reanimated": "^3.5.4", "react-native-reanimated-carousel": "^3.5.1", "react-native-restart": "^0.0.27", "react-native-safe-area-context": "^4.7.1", "react-native-screens": "^3.24.0", "react-native-select-dropdown": "^3.4.0", "react-native-svg": "^14.1.0", "react-native-toast-message": "^2.1.6", "react-native-vector-icons": "^10.0.0", "react-redux": "^8.1.2", "yarn": "^1.22.21" }, "devDependencies": { "@babel/core": "^7.20.0", "@babel/preset-env": "^7.20.0", "@babel/runtime": "^7.20.0", "@react-native/babel-preset": "^0.73.18", "@react-native/eslint-config": "^0.73.1", "@react-native/metro-config": "^0.73.2", "@react-native/typescript-config": "^0.73.1", "@tsconfig/react-native": "^3.0.0", "@types/lodash.debounce": "^4.0.8", "@types/react": "^18.2.6", "@types/react-native-vector-icons": "^6.4.14", "@types/react-redux": "^7.1.26", "@types/react-test-renderer": "^18.0.0", "babel-jest": "^29.6.3", "eslint": "^8.19.0", "jest": "^29.6.3", "prettier": "^2.8.8", "react-native-dotenv": "^3.4.9", "react-test-renderer": "18.2.0", "typescript": "5.0.4" }, "engines": { "node": ">=18" } } ``` #### `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 # # Resolve react_native_pods.rb with node to allow for hoisting # require Pod::Executable.execute_command('node', ['-p', # 'require.resolve( # "react-native/scripts/react_native_pods.rb", # {paths: [process.argv[1]]}, # )', __dir__]).strip # This instead of the above one because of react-native-permissions def node_require(script) # Resolve script with node to allow for hoisting require Pod::Executable.execute_command('node', ['-p', "require.resolve( '#{script}', {paths: [process.argv[1]]}, )", __dir__]).strip end def append_header_search_path(target, path) target.build_configurations.each do |config| config.build_settings["HEADER_SEARCH_PATHS"] ||= "$(inherited) " config.build_settings["HEADER_SEARCH_PATHS"] << path end end node_require('react-native/scripts/react_native_pods.rb') node_require('react-native-permissions/scripts/setup.rb') platform :ios, min_ios_version_supported prepare_react_native_project! # uncomment wanted permissions setup_permissions([ # 'AppTrackingTransparency', # 'BluetoothPeripheral', # 'Calendars', # 'Camera', # 'Contacts', # 'FaceID', 'LocationAccuracy', 'LocationAlways', 'LocationWhenInUse', # 'MediaLibrary', # 'Microphone', # 'Motion', # 'Notifications', # 'PhotoLibrary', # 'PhotoLibraryAddOnly', # 'Reminders', # 'Siri', # 'SpeechRecognition', # 'StoreKit', ]) # If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set. # because `react-native-flipper` depends on (FlipperKit,...) that will be excluded # # To fix this you can also exclude `react-native-flipper` using a `react-native.config.js` # ```js # module.exports = { # dependencies: { # ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}), # ``` # flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabled 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 => linkage.to_sym end # React Native Maps dependencies (above use_native_modules! function) # The following line is only needed if building on an Apple silicon Mac without rosetta. pod 'Google-Maps-iOS-Utils' rn_maps_path = '../node_modules/react-native-maps' pod 'react-native-google-maps', :path => rn_maps_path target 'test' do # START firebase stuff pod 'GoogleUtilities', :modular_headers => true pod 'Firebase', :modular_headers => true pod 'FirebaseAnalytics', :modular_headers => true pod 'FirebaseAppCheckInterop', :modular_headers => true pod 'FirebaseAuthInterop', :modular_headers => true pod 'FirebaseCore', :modular_headers => true pod 'FirebaseCoreExtension', :modular_headers => true pod 'FirebaseCoreInternal', :modular_headers => true pod 'FirebaseInstallations', :modular_headers => true pod 'FirebaseStorage', :modular_headers => true pod 'GTMSessionFetcher', :modular_headers => true # use_frameworks! :linkage => :static # $RNFirebaseAsStaticFramework = true # END firebase stuff config = use_native_modules! use_react_native!( :path => config[:reactNativePath], # Enables Flipper. # # Note that if you have use_frameworks! enabled, Flipper will not work and # you should disable the next line. :flipper_configuration => flipper_config, # An absolute path to your application root. :app_path => "#{Pod::Config.instance.installation_root}/.." ) target 'testTests' do inherit! :complete # Pods for testing end post_install do |installer| # https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202 react_native_post_install( installer, config[:reactNativePath], :mac_catalyst_enabled => false ) # __apply_Xcode_12_5_M1_post_install_workaround(installer) installer.pods_project.targets.each do |target| if ["React-cxxreact"].any? { |t| t == target.name } append_header_search_path(target, "${PODS_ROOT}/../../node_modules/react-native/ReactCommon") end end end end ``` #### `AppDelegate.m`: ```objc #import "AppDelegate.h" #import #import #import static void ClearKeychainIfNecessary() { // Checks wether or not this is the first time the app is run if ([[NSUserDefaults standardUserDefaults] boolForKey:@"HAS_RUN_BEFORE"] == NO) { // Set the appropriate value so we don't clear next time the app is launched [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"HAS_RUN_BEFORE"]; NSArray *secItemClasses = @[ (__bridge id)kSecClassGenericPassword, (__bridge id)kSecClassInternetPassword, (__bridge id)kSecClassCertificate, (__bridge id)kSecClassKey, (__bridge id)kSecClassIdentity ]; // Maps through all Keychain classes and deletes all items that match for (id secItemClass in secItemClasses) { NSDictionary *spec = @{(__bridge id)kSecClass: secItemClass}; SecItemDelete((__bridge CFDictionaryRef)spec); } } } @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // firbase [FIRApp configure]; [GMSServices provideAPIKey:@"lorem epsum"]; ClearKeychainIfNecessary(); self.moduleName = @"test"; // You can add your custom initial props in the dictionary below. // They will be passed down to the ViewController used by React Native. self.initialProps = @{}; return [super application:application didFinishLaunchingWithOptions:launchOptions]; } - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge { return [self getBundleURL]; } - (NSURL *)getBundleURL { #if DEBUG return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"]; #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`: ```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:** ``` info Fetching system and libraries information... System: OS: macOS 14.2.1 CPU: (10) arm64 Apple M1 Pro Memory: 79.28 MB / 16.00 GB Shell: version: "5.9" path: /bin/zsh Binaries: Node: version: 20.10.0 path: ~/.nvm/versions/node/v20.10.0/bin/node Yarn: version: 1.22.21 path: ~/Desktop/test/node_modules/.bin/yarn npm: version: 10.2.3 path: ~/.nvm/versions/node/v20.10.0/bin/npm Watchman: version: 2023.11.27.00 path: /opt/homebrew/bin/watchman Managers: CocoaPods: version: 1.14.3 path: /Users/admin/.rvm/gems/ruby-2.7.6/bin/pod SDKs: iOS SDK: Platforms: - DriverKit 23.2 - iOS 17.2 - macOS 14.2 - tvOS 17.2 - watchOS 10.2 Android SDK: API Levels: - "19" - "23" - "24" - "26" - "28" - "30" - "31" - "32" - "33" - "33" - "34" Build Tools: - 26.0.0 - 28.0.0 - 28.0.1 - 28.0.2 - 28.0.3 - 30.0.2 - 30.0.3 - 31.0.0 - 33.0.0 - 33.0.1 - 34.0.0 System Images: - android-24 | ARM 64 v8a - android-26 | ARM 64 v8a - android-26 | Google APIs ARM 64 v8a - android-28 | ARM 64 v8a - android-28 | Google APIs ARM 64 v8a - android-28 | Google ARM64-V8a Play ARM 64 v8a - android-29 | Google APIs ARM 64 v8a - android-31 | Google APIs ARM 64 v8a - android-33 | Google APIs ARM 64 v8a - android-34 | ARM 64 v8a - android-34 | Google APIs ARM 64 v8a Android NDK: 22.1.7171670 IDEs: Android Studio: 2022.2 AI-222.4459.24.2221.9971841 Xcode: version: 15.1/15C65 path: /usr/bin/xcodebuild Languages: Java: version: 17.0.7 path: /usr/bin/javac Ruby: version: 2.7.6 path: /Users/admin/.rvm/rubies/ruby-2.7.6/bin/ruby npmPackages: "@react-native-community/cli": Not Found react: installed: 18.2.0 wanted: 18.2.0 react-native: installed: 0.73.1 wanted: 0.73.1 react-native-macos: Not Found npmGlobalPackages: "*react-native*": Not Found Android: hermesEnabled: true newArchEnabled: false iOS: hermesEnabled: true newArchEnabled: false ``` - **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` version you're using that has this issue:** - `^18.7.3` - **`Firebase` module(s) you're using that has the issue:** - `storage` - **Are you using `TypeScript`?** - `Y` & `5.0.4`


mikehardy commented 10 months ago

However, this is causing the following error

This is not the responsibility of this repo - if you have build errors regarding other packages you must take the problems up with other repos. Some will never be fixed (like, Flipper) and you must disable or stop using the repo (like, disabling flipper)

We strictly require use_frameworks! :linkage => :static and no workarounds are viable.

tamdvyounetgroup commented 7 months ago

Any solution ?