facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
117.1k stars 24.07k forks source link

'FBReactNativeSpec/FBReactNativeSpec.h' file not found #42188

Open toscalivia83 opened 5 months ago

toscalivia83 commented 5 months ago

Description

Hello, i'm getting this error 'FBReactNativeSpec/FBReactNativeSpec.h' file not foundwith the stacktrace below.

Podfile

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

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!

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

# 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

def fix_library_search_paths(installer)
  def fix_config(config)
    lib_search_paths = config.build_settings["LIBRARY_SEARCH_PATHS"]
    if lib_search_paths
      if lib_search_paths.include?("$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)") || lib_search_paths.include?("\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"")
        # $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME) causes problem with Xcode 12.5 + arm64 (Apple M1)
        # since the libraries there are only built for x86_64 and i386.
        lib_search_paths.delete("$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)")
        lib_search_paths.delete("\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"")
        if !(lib_search_paths.include?("$(SDKROOT)/usr/lib/swift") || lib_search_paths.include?("\"$(SDKROOT)/usr/lib/swift\""))
          # however, $(SDKROOT)/usr/lib/swift is required, at least if user is not running CocoaPods 1.11
          lib_search_paths.insert(0, "$(SDKROOT)/usr/lib/swift")
        end
      end
    end
  end

  def _apply_Xcode_14_3_RC_post_install_workaround(installer)
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        current_target = config.build_settings['IPHONEOS_DEPLOYMENT_TARGET']
        minimum_target = '13.0'
        if current_target.to_f < minimum_target.to_f
          config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
        end
      end
    end
  end

  projects = installer.aggregate_targets
    .map{ |t| t.user_project }
    .uniq{ |p| p.path }
    .push(installer.pods_project)

  projects.each do |project|
    project.build_configurations.each do |config|
      fix_config(config)
    end
    project.native_targets.each do |target|
      target.build_configurations.each do |config|
        fix_config(config)
      end
    end
    project.save()
  end
end

target 'XXX' do
  config = use_native_modules!

  use_frameworks! :linkage => :static
  $RNFirebaseAsStaticFramework = true

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

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

  pod 'react-native-config/Extension', :path => '../node_modules/react-native-config'

  # pod 'RNFBFunctions', :path => '../node_modules/@react-native-firebase/functions'

  # pod 'Firebase', :modular_headers => true
  # pod 'Firebase/Storage', :modular_headers => true
  # pod 'FirebaseCore', :modular_headers => true
  # pod 'FirebaseCoreInternal', :modular_headers => true
  # pod 'GoogleUtilities', :modular_headers => true
  # pod 'FirebaseAppCheckInterop', :modular_headers => true
  # pod 'FirebaseAuthInterop', :modular_headers => true
  # pod 'FirebaseCoreExtension', :modular_headers => true
  # pod 'GTMSessionFetcher', :modular_headers => true

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

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable these next few lines.
  # use_flipper!
  post_install do |installer|
    # __apply_Xcode_12_5_M1_post_install_workaround(installer)
    installer.pods_project.build_configuration_list.build_configurations.each do |configuration|
      configuration.build_settings['CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES'] = 'YES'
    end
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)', '_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION']
        config.build_settings["ONLY_ACTIVE_ARCH"] = "NO"
        config.build_settings['CODE_SIGN_IDENTITY'] = ''
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
      end
    end
    react_native_post_install(
      installer,
      config[:reactNativePath],
      :mac_catalyst_enabled => false
    )
    fix_library_search_paths(installer)
    # _apply_Xcode_14_3_RC_post_install_workaround(installer)
  end
end

target 'XXX-tvOS' do
  # Pods for XXX-tvOS

  target 'XXX-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end
end

workspace 'XXX.xcworkspace'

And these are the dependencies I'm using in my package.json:

"dependencies": {
    "@bam.tech/react-native-image-resizer": "^3.0.5",
    "@notifee/react-native": "^5.6.0",
    "@react-native-async-storage/async-storage": "^1.21.0",
    "@react-native-clipboard/clipboard": "^1.10.0",
    "@react-native-community/datetimepicker": "^7.6.2",
    "@react-native-firebase/analytics": "17.3.0",
    "@react-native-firebase/app": "17.3.0",
    "@react-native-firebase/auth": "17.3.0",
    "@react-native-firebase/firestore": "17.3.0",
    "@react-native-firebase/functions": "17.3.0",
    "@react-native-firebase/messaging": "17.3.0",
    "@react-native-firebase/storage": "17.3.0",
    "@react-native-picker/picker": "^2.2.1",
    "@react-navigation/bottom-tabs": "^6.5.11",
    "@react-navigation/native": "^6.1.9",
    "@react-navigation/stack": "^6.3.20",
    "@sentry/react-native": "^4.14.0",
    "@stripe/stripe-react-native": "^0.33.0",
    "@tanstack/query-async-storage-persister": "^4.29.5",
    "@tanstack/react-query": "^4.29.5",
    "@tanstack/react-query-persist-client": "^4.29.5",
    "AsyncStorage": "^0.1.5",
    "dayjs": "^1.11.8",
    "firebase": "^8.2.2",
    "i18next": "^21.3.3",
    "moment": "^2.29.1",
    "numeral": "^2.0.6",
    "prettier": "^2.8.8",
    "qs": "^6.10.4",
    "react": "18.2.0",
    "react-i18next": "^11.13.0",
    "react-native": "^0.73.0",
    "react-native-app-intro-slider": "^4.0.4",
    "react-native-calendars": "^1.1284.0",
    "react-native-chart-kit": "^6.12.0",
    "react-native-config": "^1.4.5",
    "react-native-document-picker": "^8.1.3",
    "react-native-gesture-handler": "^2.14.0",
    "react-native-google-places-autocomplete": "^2.2.0",
    "react-native-image-crop-picker": "^0.39.0",
    "react-native-image-viewing": "^0.2.2",
    "react-native-localize": "^2.1.5",
    "react-native-maps": "^0.27.1",
    "react-native-modal-datetime-picker": "^13.1.2",
    "react-native-push-notification": "^8.1.1",
    "react-native-safe-area": "^0.5.1",
    "react-native-safe-area-context": "^4.8.2",
    "react-native-screens": "^3.21.0",
    "react-native-splash-screen": "^3.3.0",
    "react-native-svg": "^14.0.0",
    "react-native-swipe-gestures": "^1.0.5",
    "react-native-vector-icons": "^9.0.0",
    "react-native-web": "0.19.4",
    "react-native-webview": "^13.6.1"
  },
  "devDependencies": {
    "@babel/core": "7.12.9",
    "@babel/runtime": "7.12.5",
    "@react-native-community/eslint-config": "1.1.0",
    "@types/jest": "^27.5.1",
    "@types/react": "^17.0.2",
    "@types/react-native": "0.71.6",
    "@types/react-test-renderer": "18.0.0",
    "babel-jest": "25.5.1",
    "eslint": "6.8.0",
    "jest": "^29.2.1",
    "metro-react-native-babel-preset": "0.59.0",
    "react-test-renderer": "18.2.0",
    "typescript": "^4.6.4"
  },

This does not work with RN version 0.71.7 or latest version 0.73.0.

This works correctly on Android though.

Sorry I'm not sure if this is what was expected from the reproducer, let me know if I need to update anything

Do you have any idea why I got this error and how to fix it? Thanks in advance for your help πŸ™πŸ»

Steps to reproduce

React Native Version

0.73.0

Affected Platforms

Runtime - iOS

Output of npx react-native info

System:
  OS: macOS 14.1.1
  CPU: (8) arm64 Apple M1 Pro
  Memory: 151.02 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.2.0
    path: /usr/local/bin/node
  Yarn: Not Found
  npm:
    version: 9.6.6
    path: /usr/local/bin/npm
  Watchman:
    version: 2023.06.12.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.14.3
    path: /opt/homebrew/lib/ruby/gems/3.2.0/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:
      - "28"
      - "29"
      - "30"
      - "31"
      - "32"
      - "33"
    Build Tools:
      - 29.0.2
      - 30.0.2
      - 30.0.3
      - 31.0.0
      - 32.0.0
      - 33.0.0
      - 34.0.0
    System Images:
      - android-28 | Google APIs ARM 64 v8a
      - android-28 | Google ARM64-V8a Play ARM 64 v8a
      - android-29 | Google APIs ARM 64 v8a
      - android-29 | Google Play ARM 64 v8a
      - android-30 | Google APIs ARM 64 v8a
      - android-31 | Google Play ARM 64 v8a
      - android-32 | Google APIs ARM 64 v8a
      - android-33 | Google APIs ARM 64 v8a
      - android-33 | Google Play ARM 64 v8a
    Android NDK: 22.1.7171670
IDEs:
  Android Studio: 2022.3 AI-223.8836.35.2231.11090377
  Xcode:
    version: 15.1/15C65
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.1
    path: /usr/bin/javac
  Ruby:
    version: 3.2.2
    path: /opt/homebrew/opt/ruby/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react: Not Found
  react-native: Not Found
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: Not found
  newArchEnabled: false

Stacktrace or Logs

CompileC /Users/marion/Documents/XXX-app/ios/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-RCTVibration.build/Objects-normal/x86_64/RCTVibration.o /Users/marion/Documents/XXX-app/node_modules/react-native/Libraries/Vibration/RCTVibration.mm normal x86_64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'React-RCTVibration' from project 'Pods')
    cd /Users/marion/Documents/XXX-app/ios/Pods
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c++ -ivfsstatcache /Users/marion/Documents/XXX-app/ios/DerivedData/SDKStatCaches.noindex/iphonesimulator17.2-21C52-4f2951bfe8f3cd53c99228b0131e163e.sdkstatcache -target x86_64-apple-ios13.4-simulator -fmessage-length\=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit\=0 -fno-color-diagnostics -std\=c++20 -stdlib\=libc++ -fobjc-arc -fmodules -gmodules -fmodules-cache-path\=/Users/marion/Documents/XXX-app/ios/DerivedData/ModuleCache.noindex -fmodules-prune-interval\=86400 -fmodules-prune-after\=345600 -fbuild-session-file\=/Users/marion/Documents/XXX-app/ios/DerivedData/ModuleCache.noindex/Session.modulevalidation -fmodules-validate-once-per-build-session -fmodule-name\=RCTVibration -Wno-trigraphs -fpascal-strings -O0 -fno-common -Wno-missing-field-initializers -Wno-missing-prototypes -Werror\=return-type -Wdocumentation -Wunreachable-code -Wno-implicit-atomic-properties -Werror\=deprecated-objc-isa-usage -Wno-objc-interface-ivars -Werror\=objc-root-class -Wno-arc-repeated-use-of-weak -Wimplicit-retain-self -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wshorten-64-to-32 -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wdeprecated-implementations -Wno-c++11-extensions -Wno-implicit-fallthrough -DPOD_CONFIGURATION_DEBUG\=1 -DDEBUG\=1 -DCOCOAPODS\=1 -D_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION -DOBJC_OLD_DISPATCH_PROTOTYPES\=0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.2.sdk -fasm-blocks -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -Winvalid-offsetof -g -fvisibility-inlines-hidden -Wno-sign-conversion -Winfinite-recursion -Wmove -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wrange-loop-analysis -Wno-semicolon-before-method-body -Wunguarded-availability -fobjc-abi-version\=2 -fobjc-legacy-dispatch -index-store-path /Users/marion/Documents/XXX-app/ios/DerivedData/XXX/Index.noindex/DataStore -iquote /Users/marion/Documents/XXX-app/ios/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-RCTVibration.build/RCTVibration-generated-files.hmap -I/Users/marion/Documents/XXX-app/ios/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-RCTVibration.build/RCTVibration-own-target-headers.hmap -I/Users/marion/Documents/XXX-app/ios/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-RCTVibration.build/RCTVibration-all-non-framework-target-headers.hmap -ivfsoverlay /Users/marion/Documents/XXX-app/ios/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-RCTVibration.build/all-product-headers.yaml -iquote /Users/marion/Documents/XXX-app/ios/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-RCTVibration.build/RCTVibration-project-headers.hmap -I/Users/marion/Documents/XXX-app/ios/Build/Products/Debug-iphonesimulator/React-RCTVibration/include -I/Users/marion/Documents/XXX-app/ios/Build/Products/Debug-iphonesimulator/ReactCommon/ReactCommon.framework/Headers -I/Users/marion/Documents/XXX-app/ios/Build/Products/Debug-iphonesimulator/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core -I/Users/marion/Documents/XXX-app/ios/Build/Products/Debug-iphonesimulator/ReactCommon-Samples/ReactCommon_Samples.framework/Headers -I/Users/marion/Documents/XXX-app/ios/Build/Products/Debug-iphonesimulator/ReactCommon-Samples/ReactCommon_Samples.framework/Headers/platform/ios -I/Users/marion/Documents/XXX-app/ios/Build/Products/Debug-iphonesimulator/React-Fabric/React_Fabric.framework/Headers/react/renderer/components/view/platform/cxx -I/Users/marion/Documents/XXX-app/ios/Build/Products/Debug-iphonesimulator/React-NativeModulesApple/React_NativeModulesApple.framework/Headers -I/Users/marion/Documents/XXX-app/ios/Build/Products/Debug-iphonesimulator/React-graphics/React_graphics.framework/Headers -I/Users/marion/Documents/XXX-app/ios/Build/Products/Debug-iphonesimulator/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios -
    ... 
    -DFOLLY_NO_CONFIG -DFOLLY_MOBILE\=1 -DFOLLY_USE_LIBCPP\=1 -DFOLLY_CFG_NO_COROUTINES\=1 -Wno-comma -Wno-shorten-64-to-32 -Wno-nullability-completeness -include /Users/marion/Documents/XXX-app/ios/Pods/Target\ Support\ Files/React-RCTVibration/React-RCTVibration-prefix.pch -MMD -MT dependencies -MF /Users/marion/Documents/XXX-app/ios/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-RCTVibration.build/Objects-normal/x86_64/RCTVibration.d --serialize-diagnostics /Users/marion/Documents/XXX-app/ios/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-RCTVibration.build/Objects-normal/x86_64/RCTVibration.dia -c /Users/marion/Documents/XXX-app/node_modules/react-native/Libraries/Vibration/RCTVibration.mm -o /Users/marion/Documents/XXX-app/ios/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-RCTVibration.build/Objects-normal/x86_64/RCTVibration.o -index-unit-output-path /Pods.build/Debug-iphonesimulator/React-RCTVibration.build/Objects-normal/x86_64/RCTVibration.o

/node_modules/react-native/Libraries/Vibration/RCTVibration.mm:11:9: fatal error: 'FBReactNativeSpec/FBReactNativeSpec.h' file not found
#import <FBReactNativeSpec/FBReactNativeSpec.h>


### Reproducer

https://github.com/toscalivia83/XXX-repro

### Screenshots and Videos

<img width="1134" alt="Capture d’écran 2024-01-08 aΜ€ 20 08 00" src="https://github.com/facebook/react-native/assets/19326704/7a9f6a1b-8e54-4ec2-889d-13113ec6b142">
github-actions[bot] commented 5 months ago
:warning: Newer Version of React Native is Available!
:information_source: You are on a supported minor version, but it looks like there's a newer patch available - 0.73.2. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.
Alcoholic-Obelix commented 5 months ago

This is happening on our CI environment as well when we updated to xcode15, locally it works however we get the exact same error in our CI building the app

toscalivia83 commented 5 months ago

I think this happened to me as well after updating to xcode 15. I tried updating to Xcode 15.2, but it doesn't work either. I'll try downgrading Xcode maybe. If you find any fix let me know

However I keep having this error I logged here

toscalivia83 commented 5 months ago

Tried downgrading to Xcode 14.3.1 but it's not compatible with MacOS Sonoma 14.1.1. I upgraded MacOS to 14.2.1, it did not change anything except that it now complains with error from RCTSettingsManager file:

.../node_modules/react-native/Libraries/Settings/RCTSettingsManager.mm:10:9: fatal error: 'FBReactNativeSpec/FBReactNativeSpec.h' file not found
#import <FBReactNativeSpec/FBReactNativeSpec.h>

I also tried downgrading to RN 0.71.7 as it worked with this version before but it didn't do the job.

It doesn't work either if I run with react-native run-ios for me, with the exact same error. Were you saying it works for you locally @Alcoholic-Obelix ?

@cipolleschi do you have any idea what to do to fix this error ? πŸ™

cipolleschi commented 5 months ago

@toscalivia83 sorry to hear that you are having troubles.

The problem is in your podfile.

1st, remove these chunks. Our react_native_post_install does that for you already:

def fix_library_search_paths(installer)
  def fix_config(config)
    lib_search_paths = config.build_settings["LIBRARY_SEARCH_PATHS"]
    if lib_search_paths
      if lib_search_paths.include?("$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)") || lib_search_paths.include?("\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"")
        # $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME) causes problem with Xcode 12.5 + arm64 (Apple M1)
        # since the libraries there are only built for x86_64 and i386.
        lib_search_paths.delete("$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)")
        lib_search_paths.delete("\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"")
        if !(lib_search_paths.include?("$(SDKROOT)/usr/lib/swift") || lib_search_paths.include?("\"$(SDKROOT)/usr/lib/swift\""))
          # however, $(SDKROOT)/usr/lib/swift is required, at least if user is not running CocoaPods 1.11
          lib_search_paths.insert(0, "$(SDKROOT)/usr/lib/swift")
        end
      end
    end
  end

  def _apply_Xcode_14_3_RC_post_install_workaround(installer)
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        current_target = config.build_settings['IPHONEOS_DEPLOYMENT_TARGET']
        minimum_target = '13.0'
        if current_target.to_f < minimum_target.to_f
          config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
        end
      end
    end
  end

  projects = installer.aggregate_targets
    .map{ |t| t.user_project }
    .uniq{ |p| p.path }
    .push(installer.pods_project)

  projects.each do |project|
    project.build_configurations.each do |config|
      fix_config(config)
    end
    project.native_targets.each do |target|
      target.build_configurations.each do |config|
        fix_config(config)
      end
    end
    project.save()
  end
end

Then, remove these chunks. Either our react_native_post_install does that for you already or they are not required anymore:

installer.pods_project.build_configuration_list.build_configurations.each do |configuration|
      configuration.build_settings['CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES'] = 'YES'
    end
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)', '_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION']
        config.build_settings["ONLY_ACTIVE_ARCH"] = "NO"
        config.build_settings['CODE_SIGN_IDENTITY'] = ''
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
      end

If the problem persists, it means that one of your 3rd party dependency is not properly configured.

My suggestion, in this case, is to try and isolate what it is. So, let's start from a clean 0.73 project and let's add one dependency at a time to see what make the build stop working. Once we identify the dependency, we can try to understand why and work on a solution! :D

Alcoholic-Obelix commented 5 months ago

Tried downgrading to Xcode 14.3.1 but it's not compatible with MacOS Sonoma 14.1.1. I upgraded MacOS to 14.2.1, it did not change anything except that it now complains with error from RCTSettingsManager file:

.../node_modules/react-native/Libraries/Settings/RCTSettingsManager.mm:10:9: fatal error: 'FBReactNativeSpec/FBReactNativeSpec.h' file not found
#import <FBReactNativeSpec/FBReactNativeSpec.h>

I also tried downgrading to RN 0.71.7 as it worked with this version before but it didn't do the job.

It doesn't work either if I run with react-native run-ios for me, with the exact same error. Were you saying it works for you locally @Alcoholic-Obelix ?

@cipolleschi do you have any idea what to do to fix this error ? πŸ™

Yes, i have no problems running directly in xcode 15. Only in our CI environment. @cipolleschi my podfile is pretty barebones any guesses on why this could be happening and not with other xcode versions?

cipolleschi commented 5 months ago

@Alcoholic-Obelix if you can run your app locally but it fails on CI, can you try to point out the differences between the two? Perhaps you are building with different versions of Xcode, macOS or with different machines... It's really hard to help out not having logs or further details.

Can you set up a job in your CI to create and build a new React Native app from scratch?

toscalivia83 commented 5 months ago

Thanks for your answer @cipolleschi !

I tried updating the Podfile to this version above and running it on my real device but it still gives me this error 'FBReactNativeSpec/FBReactNativeSpec.h' file not found in React-RCTVibration 🀯

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

platform :ios, '13.0'
prepare_react_native_project!

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

target 'XXX' do
  config = use_native_modules!

  use_frameworks! :linkage => :static
  $RNFirebaseAsStaticFramework = true

  use_react_native!(:path => config[:reactNativePath], :hermes_enabled => false)

  pod 'react-native-config/Extension', :path => '../node_modules/react-native-config'

  # pod 'RNFBFunctions', :path => '../node_modules/@react-native-firebase/functions'

  # pod 'Firebase', :modular_headers => true
  # pod 'Firebase/Storage', :modular_headers => true
  # pod 'FirebaseCore', :modular_headers => true
  # pod 'FirebaseCoreInternal', :modular_headers => true
  # pod 'GoogleUtilities', :modular_headers => true
  # pod 'FirebaseAppCheckInterop', :modular_headers => true
  # pod 'FirebaseAuthInterop', :modular_headers => true
  # pod 'FirebaseCoreExtension', :modular_headers => true
  # pod 'GTMSessionFetcher', :modular_headers => true

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

  # Enables Flipper.
  #
  # Note that if you have use_frameworks! enabled, Flipper will not work and
  # you should disable these next few lines.
  # use_flipper!
  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,
      # :ccache_enabled => true
    )
  end
end

target 'XXX-tvOS' do
  # Pods for XXX-tvOS

  target 'XXX-tvOSTests' do
    inherit! :search_paths
    # Pods for testing
  end
end

workspace 'XXX.xcworkspace'
cipolleschi commented 5 months ago

Can you please:

  1. Build the app (⌘+B)
  2. Open the Xcode Issue Navigator (⌘+5)
  3. Filter for error only
  4. Take a screenshot and share it here?

I don't think that the problem is with React-RCTVibration...

Screenshot 2024-01-10 at 14 09 31

toscalivia83 commented 5 months ago
Capture d’écran 2024-01-10 aΜ€ 15 42 52

@cipolleschi unfortunately it really is the only error

Alcoholic-Obelix commented 5 months ago

@toscalivia83 go to Report Navigator (last icon) and check the errors of that build pls

Alcoholic-Obelix commented 5 months ago

@Alcoholic-Obelix if you can run your app locally but it fails on CI, can you try to point out the differences between the two? Perhaps you are building with different versions of Xcode, macOS or with different machines... It's really hard to help out not having logs or further details.

Can you set up a job in your CI to create and build a new React Native app from scratch?

The versions all match, that's gonna be tough inside my organization but i'll try. Thank you!

toscalivia83 commented 5 months ago

@Alcoholic-Obelix the error of that build is the one mentioned at the top in "Stacktrace or Logs". It did not change

toscalivia83 commented 5 months ago

Actually I made a mistake at some point and was running my project with the .xcodeproject.

Now that I'm running it with .xcworkspace it displays the error 'React/RCTBridgeDelegate.h' file not found in AppDelegate

toscalivia83 commented 5 months ago

@cipolleschi I'm trying to create a new RN project and it seems there are problems with some of the dependencies from react-native-firebase. Starting by @react-native-firebase/app which was complaining about

[!] 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.

I added:


pod 'Firebase', :modular_headers => true
  pod 'FirebaseCoreInternal', :modular_headers => true
  pod 'GoogleUtilities', :modular_headers => true
  pod 'FirebaseCore', :modular_headers => true

and it fixed it.

Then for @react-native-firebase/auth I'm getting this error I don't know how to fix yet


### Command

/opt/homebrew/lib/ruby/gems/3.2.0/bin/pod install


### Report

* What did you do?

* What did you expect to happen?

* What happened instead?

### Stack

CocoaPods : 1.12.1 Ruby : ruby 3.2.2 (2023-03-30 revision e51014f9c0) [arm64-darwin22] RubyGems : 3.4.10 Host : macOS 14.2.1 (23C71) Xcode : 15.2 (15C500b) Git : git version 2.39.3 (Apple Git-145) Ruby lib dir : /opt/homebrew/Cellar/ruby/3.2.2/lib Repositories : trunk - CDN - https://cdn.cocoapods.org/


### Plugins

cocoapods-deintegrate : 1.0.5 cocoapods-plugins : 1.0.0 cocoapods-search : 1.0.1 cocoapods-trunk : 1.6.0 cocoapods-try : 1.2.0


### Podfile

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

platform :ios, min_ios_version_supported
prepare_react_native_project!

# 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

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 'AwesomeWORKINGProject' do
  config = use_native_modules!

  pod 'Firebase', :modular_headers => true
  pod 'FirebaseCoreInternal', :modular_headers => true
  pod 'GoogleUtilities', :modular_headers => true
  pod 'FirebaseCore', :modular_headers => true

  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 'AwesomeWORKINGProjectTests' 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
    )
  end
end

Error

LoadError - dlopen(/opt/homebrew/lib/ruby/gems/3.2.0/gems/ffi-1.16.3/lib/ffi_c.bundle, 0x0009): tried: '/opt/homebrew/lib/ruby/gems/3.2.0/gems/ffi-1.16.3/lib/ffi_c.bundle' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/lib/ruby/gems/3.2.0/gems/ffi-1.16.3/lib/ffi_c.bundle' (no such file), '/opt/homebrew/lib/ruby/gems/3.2.0/gems/ffi-1.16.3/lib/ffi_c.bundle' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')) - /opt/homebrew/lib/ruby/gems/3.2.0/gems/ffi-1.16.3/lib/ffi_c.bundle
<internal:/opt/homebrew/Cellar/ruby/3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
<internal:/opt/homebrew/Cellar/ruby/3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/ffi-1.16.3/lib/ffi.rb:5:in `rescue in <top (required)>'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/ffi-1.16.3/lib/ffi.rb:2:in `<top (required)>'
<internal:/opt/homebrew/Cellar/ruby/3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
<internal:/opt/homebrew/Cellar/ruby/3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/ethon-0.16.0/lib/ethon.rb:3:in `<top (required)>'
<internal:/opt/homebrew/Cellar/ruby/3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
<internal:/opt/homebrew/Cellar/ruby/3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/typhoeus-1.4.1/lib/typhoeus.rb:2:in `<top (required)>'
<internal:/opt/homebrew/Cellar/ruby/3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
<internal:/opt/homebrew/Cellar/ruby/3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/cocoapods-core-1.12.1/lib/cocoapods-core/cdn_source.rb:440:in `download_typhoeus_impl_async'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/cocoapods-core-1.12.1/lib/cocoapods-core/cdn_source.rb:372:in `download_and_save_with_retries_async'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/cocoapods-core-1.12.1/lib/cocoapods-core/cdn_source.rb:365:in `download_file_async'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/cocoapods-core-1.12.1/lib/cocoapods-core/cdn_source.rb:338:in `download_file'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/cocoapods-core-1.12.1/lib/cocoapods-core/cdn_source.rb:284:in `ensure_versions_file_loaded'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/cocoapods-core-1.12.1/lib/cocoapods-core/cdn_source.rb:208:in `search'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/cocoapods-core-1.12.1/lib/cocoapods-core/source/aggregate.rb:83:in `block in search'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/cocoapods-core-1.12.1/lib/cocoapods-core/source/aggregate.rb:83:in `select'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/cocoapods-core-1.12.1/lib/cocoapods-core/source/aggregate.rb:83:in `search'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/cocoapods-1.12.1/lib/cocoapods/resolver.rb:416:in `create_set_from_sources'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/cocoapods-1.12.1/lib/cocoapods/resolver.rb:385:in `find_cached_set'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/cocoapods-1.12.1/lib/cocoapods/resolver.rb:360:in `specifications_for_dependency'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/cocoapods-1.12.1/lib/cocoapods/resolver.rb:165:in `search_for'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/cocoapods-1.12.1/lib/cocoapods/resolver.rb:274:in `block in sort_dependencies'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/cocoapods-1.12.1/lib/cocoapods/resolver.rb:267:in `each'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/cocoapods-1.12.1/lib/cocoapods/resolver.rb:267:in `sort_by'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/cocoapods-1.12.1/lib/cocoapods/resolver.rb:267:in `sort_by!'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/cocoapods-1.12.1/lib/cocoapods/resolver.rb:267:in `sort_dependencies'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/molinillo-0.8.0/lib/molinillo/delegates/specification_provider.rb:60:in `block in sort_dependencies'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/molinillo-0.8.0/lib/molinillo/delegates/specification_provider.rb:77:in `with_no_such_dependency_error_handling'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/molinillo-0.8.0/lib/molinillo/delegates/specification_provider.rb:59:in `sort_dependencies'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:754:in `push_state_for_requirements'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:744:in `require_nested_dependencies_for'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:727:in `activate_new_spec'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:684:in `attempt_to_activate'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:254:in `process_topmost_state'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:182:in `resolve'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/molinillo-0.8.0/lib/molinillo/resolver.rb:43:in `resolve'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/cocoapods-1.12.1/lib/cocoapods/resolver.rb:94:in `resolve'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/cocoapods-1.12.1/lib/cocoapods/installer/analyzer.rb:1082:in `block in resolve_dependencies'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/cocoapods-1.12.1/lib/cocoapods/user_interface.rb:64:in `section'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/cocoapods-1.12.1/lib/cocoapods/installer/analyzer.rb:1080:in `resolve_dependencies'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/cocoapods-1.12.1/lib/cocoapods/installer/analyzer.rb:125:in `analyze'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/cocoapods-1.12.1/lib/cocoapods/installer.rb:422:in `analyze'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/cocoapods-1.12.1/lib/cocoapods/installer.rb:244:in `block in resolve_dependencies'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/cocoapods-1.12.1/lib/cocoapods/user_interface.rb:64:in `section'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/cocoapods-1.12.1/lib/cocoapods/installer.rb:243:in `resolve_dependencies'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/cocoapods-1.12.1/lib/cocoapods/installer.rb:162:in `install!'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/cocoapods-1.12.1/lib/cocoapods/command/install.rb:52:in `run'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/cocoapods-1.12.1/lib/cocoapods/command.rb:52:in `run'
/opt/homebrew/lib/ruby/gems/3.2.0/gems/cocoapods-1.12.1/bin/pod:55:in `<top (required)>'
/opt/homebrew/lib/ruby/gems/3.2.0/bin/pod:25:in `load'
/opt/homebrew/lib/ruby/gems/3.2.0/bin/pod:25:in `<main>'

――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

[!] Oh no, an error occurred.

Search for existing GitHub issues similar to yours:
https://github.com/CocoaPods/CocoaPods/search?q=dlopen%28%2Fopt%2Fhomebrew%2Flib%2Fruby%2Fgems%2F3.2.0%2Fgems%2Fffi-1.16.3%2Flib%2Fffi_c.bundle%2C+0x0009%29%3A+tried%3A+%27%2Fopt%2Fhomebrew%2Flib%2Fruby%2Fgems%2F3.2.0%2Fgems%2Fffi-1.16.3%2Flib%2Fffi_c.bundle%27+%28mach-o+file%2C+but+is+an+incompatible+architecture+%28have+%27x86_64%27%2C+need+%27arm64%27%29%29%2C+%27%2FSystem%2FVolumes%2FPreboot%2FCryptexes%2FOS%2Fopt%2Fhomebrew%2Flib%2Fruby%2Fgems%2F3.2.0%2Fgems%2Fffi-1.16.3%2Flib%2Fffi_c.bundle%27+%28no+such+file%29%2C+%27%2Fopt%2Fhomebrew%2Flib%2Fruby%2Fgems%2F3.2.0%2Fgems%2Fffi-1.16.3%2Flib%2Fffi_c.bundle%27+%28mach-o+file%2C+but+is+an+incompatible+architecture+%28have+%27x86_64%27%2C+need+%27arm64%27%29%29+-+%2Fopt%2Fhomebrew%2Flib%2Fruby%2Fgems%2F3.2.0%2Fgems%2Fffi-1.16.3%2Flib%2Fffi_c.bundle&type=Issues

If none exists, create a ticket, with the template displayed above, on:
https://github.com/CocoaPods/CocoaPods/issues/new

Be sure to first read the contributing guide for details on how to properly submit a ticket:
https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md

Don't forget to anonymize any private data!

Looking for related issues on cocoapods/cocoapods...
Searching for inspections failed: undefined method `map' for nil:NilClass

Any idea how to fix this?

Then I'll have these dependencies to add and I'll be done: @react-native-firebase/firestore @react-native-firebase/analytics @react-native-firebase/functions @react-native-firebase/messaging @react-native-firebase/storage

If it gives you any idea on what I can do to make it work let me know!

toscalivia83 commented 5 months ago

I created a new repo and had to update a lot of dependencies on ios and android. The ones which were creating problemes were the ones from firebase (auth, messaging, firestore), I had to upgrade react-native-vector-icons in ios, and I had problems with the version of stripe in ios and Android, and reinstall as normal dependency @babel/runtime.

These are the versions I use now:

"dependencies": {
    "@babel/runtime": "^7.23.8",
    "@bam.tech/react-native-image-resizer": "^3.0.7",
    "@notifee/react-native": "^7.8.2",
    "@react-native-async-storage/async-storage": "^1.15.9",
    "@react-native-clipboard/clipboard": "^1.11.2",
    "@react-native-community/datetimepicker": "6.7.3",
    "@react-native-firebase/analytics": "^18.7.3",
    "@react-native-firebase/app": "^18.7.3",
    "@react-native-firebase/auth": "^18.7.3",
    "@react-native-firebase/firestore": "^18.7.3",
    "@react-native-firebase/functions": "^18.7.3",
    "@react-native-firebase/messaging": "^18.7.3",
    "@react-native-firebase/storage": "^18.7.3",
    "@react-native-picker/picker": "^2.6.1",
    "@stripe/stripe-react-native": "^0.35.0",
    "firebase": "^10.7.1",
    "react": "18.2.0",
    "react-native": "0.73.2",
    "react-native-app-intro-slider": "^4.0.4",
    "react-native-calendars": "^1.1284.0",
    "react-native-chart-kit": "^6.12.0",
    "react-native-config": "^1.4.5",
    "react-native-document-picker": "^8.1.3",
    "react-native-gesture-handler": "^1.10.3",
    "react-native-google-places-autocomplete": "^2.2.0",
    "react-native-image-crop-picker": "^0.40.2",
    "react-native-vector-icons": "^10.0.3"
  },
  "devDependencies": {
    "@babel/core": "^7.20.0",
    "@babel/preset-env": "^7.20.0",
    "@react-native-picker/picker": "^2.2.1",
    "@react-native/babel-preset": "0.73.19",
    "@react-native/eslint-config": "0.73.2",
    "@react-native/metro-config": "0.73.3",
    "@react-native/typescript-config": "0.73.1",
    "@react-navigation/bottom-tabs": "^5.11.15",
    "@react-navigation/native": "^5.9.8",
    "@react-navigation/stack": "^5.12.8",
    "@sentry/react-native": "^4.15.2",
    "@tanstack/query-async-storage-persister": "^4.29.5",
    "@tanstack/react-query": "^4.29.5",
    "@tanstack/react-query-persist-client": "^4.29.5",
    "@types/react": "^18.2.6",
    "@types/react-test-renderer": "^18.0.0",
    "AsyncStorage": "^0.1.5",
    "babel-jest": "^29.6.3",
    "dayjs": "^1.11.8",
    "eslint": "^8.19.0",
    "i18next": "^21.3.3",
    "jest": "^29.6.3",
    "moment": "^2.29.1",
    "numeral": "^2.0.6",
    "prettier": "2.8.8",
    "qs": "^6.10.4",
    "react-i18next": "^11.13.0",
    "react-native-image-crop-picker": "^0.39.0",
    "react-native-image-viewing": "^0.2.2",
    "react-native-localize": "^2.1.5",
    "react-native-maps": "^0.27.1",
    "react-native-modal-datetime-picker": "^13.1.2",
    "react-native-push-notification": "^8.1.1",
    "react-native-safe-area": "^0.5.1",
    "react-native-safe-area-context": "^3.3.2",
    "react-native-screens": "^2.18.1",
    "react-native-svg": "^13.9.0",
    "react-native-swipe-gestures": "^1.0.5",
    "react-native-web": "0.19.4",
    "react-native-webview": "^13.6.2",
    "react-test-renderer": "18.2.0",
    "typescript": "5.0.4"
  },
  "engines": {
    "node": ">=18"
  }

And my Podfile is pretty simple:

# 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

platform :ios, min_ios_version_supported
prepare_react_native_project!

# 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
use_frameworks! :linkage => :static

target 'XXX' do
  config = use_native_modules!

  # pod 'Firebase', :modular_headers => true
  # pod 'GoogleUtilities', :modular_headers => true
  # pod 'FirebaseCore', :modular_headers => true

  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 'XXXTests' 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
    )
  end
end

Good luck if you're stuck with this!

cipolleschi commented 5 months ago

to understand @toscalivia83, did creating a new repo fixed the problem or is it still there?

DanielJaimes commented 5 months ago

Removing the build folder works for me

IMG_0148

remove in ios folder: /build /Pods /Podfile.lock

then run - cd ios && pod install --repo-update and run the project with Xcode again

toscalivia83 commented 5 months ago

@cipolleschi Creating a new repo helped me to fix the problem because I could add all the dependencies one by one and upgrade the versions. Now it works with the package.json and Podfile I posted above. Thanks for your help so far! πŸ™

@DanielJaimes unfortunately I tried that but it did not work for me