Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 17237

React Native iOS Build Failed: fmt/src/format.cc compilation error after downloading Pod file

$
0
0

I am working on a React Native project, and after successfully downloading the Pod file, I am facing a build failure when running the app on iOS. Here’s what happens:

  1. I run the following command to start the app:

  2. rm -rf ios/Podsrm -rf ios/DerivedDatarm -rf ~/Library/Developer/Xcode/DerivedDatacd ios && pod install --repo-update && cd ..se64
  3. "ios:dev": "npx react-native run-ios --scheme 'VeeraHealthPcosDev' --configuration Debug --simulator='iPhone 13'" 
  4. The build fails, and I get this error message:

    ** BUILD FAILED **The following build commands failed:        CompileC /Users/rac/Library/Developer/Xcode/DerivedData/veerahealthpcos-fjsocvigquxpakdaumsxcfhhcmhw/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/fmt.build/Objects-normal/x86_64/format.o /Users/rac/Desktop/working/rn-veera-health-pcos/ios/Pods/fmt/src/format.cc normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'fmt' from project 'Pods')        Building workspace veerahealthpcos with scheme VeeraHealthPcosDev and configuration Debug(2 failures)info Run CLI with --verbose flag for more details.

Environment:

  • React Native version: 0.69.12

  • Node.js version: 16.20.1

  • Xcode version: 16.3 (Build version: 16E140)

I can’t update to the latest version of React Native, as my project depends on older package versions that are not compatible with the latest React Native version. I’ve tried cleaning the build folder, reinstalling the dependencies, and even updating the Pods, but the issue persists.

I suspect the problem may be related to the file ios/Pods/fmt/src/format.cc, but I’m not sure how to resolve it. Has anyone else encountered this issue or have any suggestions for a solution?

Inside the post_install do |installer| block, I added the following to modify the build settings:

installer.pods_project.targets.each do |target|  target.build_configurations.each do |config|    # Allow arm64 (remove previous exclusion of arm64):    config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'x86_64'    config.build_settings['ONLY_ACTIVE_ARCH'] = 'YES'  endendinstaller.pods_project.targets.each do |target|  if target.name == 'fmt'    target.build_configurations.each do |config|      # Force C++17 (required by modern fmt) and libc++      config.build_settings['CLANG_CXX_LANGUAGE_STANDARD'] = 'c++17'      config.build_settings['CLANG_CXX_LIBRARY'] = 'libc++'      # Disable Clang modules (can avoid module import issues)      config.build_settings['CLANG_ENABLE_MODULES'] = 'NO'      config.build_settings['CLANG_MODULES_AUTOLINK'] = 'NO'      # (Optional) Add any needed defines, e.g. for compatibility      config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)', '_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION']    end  endendinstaller.pods_project.targets.each do |target|  if target.name == 'OneSignalNotificationServiceExtension'    target.build_configurations.each do |config|      # Exclude x86_64 on simulator so we only build arm64      config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'x86_64'      # Only build the active arch in debug      config.build_settings['ONLY_ACTIVE_ARCH'] = 'YES'    end  endend

After running the app, I expected the build to succeed, but instead, I received the following error:

The following build commands failed:        SwiftEmitModule normal x86_64 Emitting module for OneSignalNotificationServiceExtension (in target 'OneSignalNotificationServiceExtension' from project 'xyz')        SwiftCompile normal x86_64 /Users/rac/Desktop/working/rn-veera-health-pcos/ios/OneSignalNotificationServiceExtension/NotificationService.swift (in target 'OneSignalNotificationServiceExtension' from project 'xyz')        Building workspace xyz with scheme VeeraHealthPcosDev and configuration Debug(3 failures)

It appears to be an issue related to the OneSignalNotificationServiceExtension. Any suggestions on how to resolve this or fix the build failure would be appreciated.


Viewing all articles
Browse latest Browse all 17237

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>