Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native M1 Mac build failure with target "React-Codegen"

When I run the command npx react-native run-ios in my terminal on my Mac I receive the error

CompileC /Users/jessicageorge-mannella/Library/Developer/Xcode/DerivedData/AwesomeProject-ctnixtnnzajiwuhfvbyaxlajljew/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-Codegen.build/Objects-normal/arm64/FBReactNativeSpec-generated.o /Users/jessicageorge-mannella/Documents/testing/AwesomeProject/ios/build/generated/ios/FBReactNativeSpec/FBReactNativeSpec-generated.mm normal arm64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'React-Codegen' from project 'Pods')
(1 failure)

I'm running react native 0.71.5, ruby version 2.6.10, cocoapods version 1.11.3, node version 18.15.0, Xcode version 14.3 and I tried even re-installing MacOS on my laptop in attempt to delete broken version installs. Here's the full list of my installed packages in relation to react-native as-well as some system information

System:
    OS: macOS 13.3
    CPU: (10) arm64 Apple M1 Pro
    Memory: 150.44 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.15.0 - /usr/local/bin/node
    Yarn: Not Found
    npm: 9.6.3 - /usr/local/bin/npm
    Watchman: 2023.03.27.00 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: 1.11.3 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4
    Android SDK: Not Found
  IDEs:
    Android Studio: Not Found
    Xcode: 14.3/14E222b - /usr/bin/xcodebuild
  Languages:
    Java: Not Found
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.2.0 => 18.2.0
    react-native: 0.71.5 => 0.71.5
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Thanks!

like image 374
Osa Avatar asked Aug 25 '26 14:08

Osa


1 Answers

Quick Fix: Go to Pods -> Select React-Codegen from Build Settings and update iOS Deployment Target to iOS 12.4.

pods build settings

Stable Fix: Refer https://github.com/travis-mark/lrn/commit/015854716feadd61a904d5a603b027426472f863

like image 62
Sweta Tanwar Avatar answered Aug 27 '26 02:08

Sweta Tanwar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!