I’m working on a complex React Native project that I inherited, and I’m encountering persistent build failures for the iOS version. The issues started after I briefly switched to the main branch to check some previous implementations and then switched back.
This was after successfully working on my branch for months.
Environment
- React Native: 0.71.8
- iOS Platform: 13.0
- Node.js: 22.1.0
- macOS: Sonoma 14.3
- Xcode: 15.2
The Problem
After switching branches, the app stopped building. I’ve tried several solutions, but the errors persist. The most recent error is related to RCT-Folly:
The following build commands failed:
CompileC /Users/archiewyles/Library/Developer/Xcode/DerivedData/2nite-ezjbgxlaqwrrugbyfonxzoflhrcx/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RCT-Folly.build/Objects-normal/x86_64/json.o /Users/archiewyles/Desktop/2nite-app/ios/Pods/RCT-Folly/folly/json.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'RCT-Folly' from project 'Pods')
Previously, I encountered issues with GoogleDataTransport and libwebp:
The following build commands failed:
CompileC /Users/archiewyles/Library/Developer/Xcode/DerivedData/2nite-ezjbgxlaqwrrugbyfonxzoflhrcx/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/GoogleDataTransport.build/Objects-normal/x86_64/cct.nanopb.o /Users/archiewyles/Desktop/2nite-app/ios/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/Protogen/nanopb/cct.nanopb.c normal x86_64 c com.apple.compilers.llvm.clang.1_0.compiler (in target 'GoogleDataTransport' from project 'Pods')
What I’ve Tried
- Cleaning the build folder and derived data
- Updating pods
- Modifying the Podfile to include specific versions and compiler flags
- Reinstalling node modules
Podfile
Here’s the current 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, '13.0'
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 '2nite' 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 => flags[:hermes_enabled],
:hermes_enabled => flags[:fabric_enabled],
: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 => flipper_config,
# An absolute path to your application root.
:app_path => "#{Pod::Config.instance.installation_root}/.."
)
# Ajoute les pods Firebase
pod 'Firebase/Core'
pod 'Firebase/Messaging'
target '2niteTests' do
inherit! :complete
# Pods for testing
end
permissions_path = '../node_modules/react-native-permissions/ios'
pod 'Permission-Camera', :path => "#{permissions_path}/Camera"
pod 'Permission-PhotoLibrary', :path => "#{permissions_path}/PhotoLibrary"
pod 'Permission-PhotoLibraryAddOnly', :path => "#{permissions_path}/PhotoLibraryAddOnly"
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)
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
config.build_settings["ONLY_ACTIVE_ARCH"] = "YES"
end
end
installer.pods_project.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
end
package.json
Here are my npm packages:
"dependencies": {
"@bam.tech/react-native-image-resizer": "^3.0.5",
"@dotmind/rn-shadow-generator": "^1.0.4",
"@expo/react-native-action-sheet": "^3.9.0",
"@invertase/react-native-apple-authentication": "^2.2.1",
"@notifee/react-native": "^7.7.1",
"@react-native-async-storage/async-storage": "^1.15.5",
"@react-native-clipboard/clipboard": "^1.11.2",
"@react-native-community/art": "^1.2.0",
"@react-native-community/datetimepicker": "^7.1.0",
"@react-native-community/geolocation": "^3.0.6",
"@react-native-community/push-notification-ios": "^1.8.0",
"@react-native-firebase/app": "^14.12.0",
"@react-native-firebase/auth": "^14.12.0",
"@react-native-firebase/database": "^14.12.0",
"@react-native-firebase/dynamic-links": "^14.12.0",
"@react-native-firebase/firestore": "^14.12.0",
"@react-native-firebase/functions": "^14.12.0",
"@react-native-firebase/messaging": "^14.12.0",
"@react-native-firebase/storage": "^14.12.0",
"@react-native-masked-view/masked-view": "^0.3.1",
"@react-native-picker/picker": "^2.4.10",
"@react-navigation/bottom-tabs": "^5.11.11",
"@react-navigation/material-bottom-tabs": "^5.3.15",
"@react-navigation/material-top-tabs": "^5.3.15",
"@react-navigation/native": "^5.9.4",
"@react-navigation/stack": "^5.14.5",
"@stripe/stripe-react-native": "^0.27.2",
"@twotalltotems/react-native-otp-input": "^1.3.11",
"@types/firebase": "^3.2.1",
"axios": "^0.27.2",
"dayjs": "^1.10.6",
"deprecated-react-native-prop-types": "^4.1.0",
"faker": "^6.6.6",
"firebase": "^10.12.4",
"geolib": "^3.3.4",
"global": "^4.4.0",
"i": "^0.3.7",
"jetifier": "^2.0.0",
"lodash": "^4.17.21",
"moment": "^2.29.3",
"npm": "^8.19.3",
"npm-run-all": "^4.1.5",
"react": "18.2.0",
"react-native": "0.71.8",
"react-native-barcode-builder": "^2.0.0",
"react-native-camera": "^4.2.1",
"react-native-config": "^1.5.0",
"react-native-country-picker-modal": "^2.0.0",
"react-native-element-dropdown": "^1.8.10",
"react-native-extended-stylesheet": "^0.12.0",
"react-native-fast-image": "^8.5.11",
"react-native-fs": "^2.20.0",
"react-native-geocoding": "^0.5.0",
"react-native-geolocation-service": "^5.3.0",
"react-native-gesture-handler": "^2.10.2",
"react-native-gifted-chat": "^2.4.0",
"react-native-image-blur-loading": "^1.1.6",
"react-native-image-crop-picker": "^0.36.2",
"react-native-image-progress": "^1.2.0",
"react-native-image-zoom-viewer": "^3.0.1",
"react-native-keyboard-aware-scroll-view": "^0.9.4",
"react-native-linear-gradient": "^3.0.0-alpha.1",
"react-native-maps": "1.8.0",
"react-native-modal": "^13.0.1",
"react-native-modal-datetime-picker": "^13.1.2",
"react-native-otp-textinput": "^1.1.1",
"react-native-pager-view": "^5.2.1",
"react-native-paper": "^4.9.2",
"react-native-parsed-text": "^0.0.22",
"react-native-permissions": "^3.0.4",
"react-native-picker-select": "^8.0.4",
"react-native-progress": "^5.0.0",
"react-native-push-notification": "^7.4.0",
"react-native-qrcode-scanner": "^1.5.5",
"react-native-qrcode-svg": "^6.2.0",
"react-native-raw-bottom-sheet": "^2.2.0",
"react-native-reanimated": "3.0.0",
"react-native-rename": "^3.2.12",
"react-native-responsive-screen": "^1.4.2",
"react-native-safe-area-context": "4.5.3",
"react-native-screens": "^3.4.0",
"react-native-share": "^6.3.0",
"react-native-simple-toast": "^1.1.0",
"react-native-skeleton-placeholder": "^5.2.3",
"react-native-smooth-pincode-input": "^1.0.9",
"react-native-snap-carousel": "^3.9.1",
"react-native-splash-screen": "^3.2.0",
"react-native-svg": "13.9.0",
"react-native-svg-transformer": "1.1.0",
"react-native-swiper-flatlist": "^3.0.16",
"react-native-tab-view": "^3.0.1",
"react-native-vector-icons": "^9.2.0",
"react-redux": "^7.2.4",
"redux-logger": "^3.0.6",
"redux-persist": "^6.0.0",
"stripe": "^16.6.0",
"use-debounce": "^9.0.4"
},
Additional Context
- This is a complex project with numerous dependencies, making it challenging to update packages.
- The project was not originally mine, so I’m not fully familiar with all its intricacies.
- The build was working fine before the branch switch.
I’m hoping someone might know how to fix these errors and get the build working again. It’s been two days and it’s unbelievably frustrating (and delaying my job).
Any insights or suggestions would be greatly appreciated. Thank you in advance for your help!