skip to Main Content

today I updated Xcode from 14.2 to 15, then I got many errors like below:
Can someone give me some advice?

I have tried to :

  1. Delete derivedData.
  2. Clean project
  3. Re-install pod

But no luck
XCode 15

Mac m1

React native 0.71.8

React 18.2.0

I have posted the question on react native github repo, someone can check more here: https://github.com/facebook/react-native/issues/39712

enter image description here

2

Answers


  1. Step 1

    find Hermes code in the pod file and disable it

    use_react_native!(
        :path => config[:reactNativePath],
        # to enable hermes on iOS, change `false` to `true` and then install pods
        :hermes_enabled => false
                        
      )
    

    Add the following block at the end of the podfile

      use_flipper!({ "Flipper-DoubleConversion" => "1.1.7" })
    
      post_install do |installer|
        react_native_post_install(installer)
        __apply_Xcode_12_5_M1_post_install_workaround(installer)
      end
    end
    

    run below comand in ios

    $ sudo gem install cocoapods-deintegrate cocoapods-clean
    $ pod deintegrate
    $ pod clean
    $ pod install
    

    take a look here also

    Login or Signup to reply.
  2. Add this code to your Podfile inside post_install and install pods again

    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']
           end
         end
    

    for example my podfile

      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
        )
        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']
               end
             end
      end
    end
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search