I use XCode 13.4.1 and react-native 0.73.3. Building my react-native project from XCode, I get the next error in RNReanimated package:
Lexical or Preprocessor Issue:'react/renderer/graphics/Float.h' file not found. Pods > Development Pods > React-Fabric > core > ComponentDescriptor.h
If I comment out this line, I get error in other ".h" file not found. It seems like some paths are missing, but I don't know which ones.
This is my Podfile, where I had to add some changes:
require_relative '../node_modules/react-native/scripts/react_native_pods' require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' # 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, '13.4' prepare_react_native_project! install! 'cocoapods', :deterministic_uuids => false 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 'MyApplication' do config = use_native_modules! # Flags change depending on the env values. flags = get_default_flags() use_react_native!( :path => config[:reactNativePath], # Hermes is now enabled by default. Disable by setting this flag to false. # Upcoming versions of React Native may rely on get_default_flags(), but # we make it explicit here to aid in the React Native upgrade process. :hermes_enabled => true, :fabric_enabled => flags[:fabric_enabled], # Enables Flipper. # # Note that if you have use_frameworks! enabled, Flipper will not work and # you should disable the next line. :flipper_configuration => FlipperConfiguration.enabled, # An absolute path to your application root. :app_path =>"#{Pod::Config.instance.installation_root}/.." ) pod 'RNFS', :path =>'../node_modules/react-native-fs' pod 'RNVectorIcons', :path =>'../node_modules/react-native-vector-icons' pod 'react-native-netinfo', :path =>'../node_modules/@react-native-community/netinfo' pod 'Firebase', :modular_headers => true pod 'FirebaseCoreInternal', :modular_headers => true pod 'GoogleUtilities', :modular_headers => true pod 'FirebaseCore', :modular_headers => true target 'MyApplicationTests' 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, # :ccache_enabled => true ) end end
And this is my package.json file, from react-native project:
{"name": "myapplication","version": "1.6.3","private": true,"scripts": {"android": "react-native run-android","ios": "react-native run-ios","start": "react-native start","test": "jest","lint": "eslint . --ext .js,.jsx,.ts,.tsx","postinstall": "patch-package" },"dependencies": {"@react-native-community/cli": "^13.6.6","@react-native-community/datetimepicker": "^3.5.2","@react-native-community/masked-view": "^0.1.11","@react-native-community/netinfo": "^6.1.0","@react-native-community/progress-bar-android": "^1.0.4","@react-native-community/progress-view": "^1.3.1","@react-native-firebase/app": "^18.8.0","@react-native-firebase/messaging": "^18.8.0","@react-native-picker/picker": "^1.16.5","@react-native/metro-config": "^0.74.81","@react-navigation/bottom-tabs": "^6.0.1","@react-navigation/native": "^6.0.1","@react-navigation/stack": "^6.0.1","@types/react": "^17","axios": "^1.6.7","deprecated-react-native-prop-types": "^2.3.0","patch-package": "^6.4.7","postinstall-postinstall": "^2.1.0","react": "18.2.0","react-native": "0.73.3","react-native-autocomplete-dropdown": "1.1.6","react-native-barcode-mask": "^1.2.4","react-native-blob-util": "^0.16.2","react-native-bottomsheet": "^2.5.2","react-native-bouncy-checkbox": "^2.1.3","react-native-camera": "^4.2.1","react-native-eject": "^0.1.2","react-native-file-viewer": "^2.1.4","react-native-fs": "^2.18.0","react-native-gesture-handler": "^1.10.3","react-native-gradle-plugin": "^0.71.19","react-native-image-pan-zoom": "^2.1.12","react-native-mmkv": "^2.12.2","react-native-paper": "^4.9.2","react-native-pdf": "^6.6.0","react-native-picker-select": "^8.0.4","react-native-raw-bottom-sheet": "^2.2.0","react-native-reanimated": "^2.2.0","react-native-render-html": "^6.0.5","react-native-safe-area-context": "^3.3.0","react-native-screens": "^3.5.0","react-native-splash-screen": "^3.2.0","react-native-swipe-list-view": "^3.2.9","react-native-swiper": "^1.6.0","react-native-toast-message": "^1.4.9","react-native-vector-icons": "9.2.0","react-native-webview": "^11.6.6","react-native-zip-archive": "^6.0.3","rn-fetch-blob": "^0.12.0","yarn": "^1.22.19" },"devDependencies": {"@babel/core": "^7.15.0","@babel/runtime": "^7.14.8","@react-native-community/eslint-config": "^3.0.0","@types/jest": "^26.0.24","@types/react-native": "^0.64.12","@types/react-native-vector-icons": "^6.4.8","@types/react-test-renderer": "^17.0.1","babel-jest": "^27.0.6","eslint": "^7.32.0","jest": "^27.0.6","metro-config": "^0.80.5","metro-react-native-babel-preset": "^0.72.1","react-test-renderer": "^18.2.0","typescript": "^4.3.5","yarn-upgrade-all": "^0.5.4" },"resolutions": {"@types/react": "^17" },"jest": {"preset": "react-native","moduleFileExtensions": ["ts","tsx","js","jsx","json","node" ] },"description": "My custom App","main": "index.js","repository": "","author": "author","license": "Private" }
I have had to patch RNReanimated.podspec in order to set C++ compiler version:
s.pod_target_xcconfig = {"USE_HEADERMAP" => "YES","HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_TARGET_SRCROOT)\" \"$(PODS_ROOT)/#{folly_prefix}Folly\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/Headers/Private/React-Core\" ","FRAMEWORK_SEARCH_PATHS" => "\"${PODS_CONFIGURATION_BUILD_DIR}/React-hermes\"","CLANG_CXX_LANGUAGE_STANDARD" => "c++17", <--- I've added this line
}
If I should add any other file in order to solve this issue, please ask me.