react-native: [Fixed & Shipped in latest releases] Upgrading Xcode to 15.3 results in build error - `Called object type 'facebook::flipper::SocketCertificateProvider' (aka 'int') is not a function or function pointer`

[!IMPORTANT] The latest official update from the React Native Team is available here

Description

Called object type ‘facebook:🐬:SocketCertificateProvider’ (aka ‘int’) is not a function or function pointer image

Steps to reproduce

run

React Native Version

0.73.5

Affected Platforms

Runtime - iOS

Output of npx react-native info

System:
  OS: macOS 14.3.1
  CPU: (10) arm64 Apple M1 Max
  Memory: 2.02 GB / 32.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.9.0
    path: ~/.nvm/versions/node/v20.9.0/bin/node
  Yarn:
    version: 1.22.19
    path: ~/.nvm/versions/node/v20.9.0/bin/yarn
  npm:
    version: 10.1.0
    path: ~/.nvm/versions/node/v20.9.0/bin/npm
  Watchman:
    version: 2023.11.06.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.14.3
    path: /Users/tom/.rbenv/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.4
      - iOS 17.4
      - macOS 14.4
      - tvOS 17.4
      - visionOS 1.1
      - watchOS 10.4
  Android SDK: Not Found
IDEs:
  Android Studio: 2023.1 AI-231.9392.1.2311.11330709
  Xcode:
    version: 15.3/15E204a
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.9
    path: /usr/bin/javac
  Ruby:
    version: 3.2.0
    path: /Users/tom/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.73.5
    wanted: 0.73.5
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

Stacktrace or Logs

not

Reproducer

not

Screenshots and Videos

No response

About this issue

  • Original URL
  • State: closed
  • Created 4 months ago
  • Reactions: 61
  • Comments: 70 (2 by maintainers)

Commits related to this issue

Most upvoted comments

FlipperTransportTypes

I was able to find temp fix with adding #include <functional> to ios/Pods/Flipper/xplat/Flipper/FlipperTransportTypes.h may be an flipper needs an upgrade

Edit: can confirm flipper repo has this patch https://github.com/facebook/flipper/commit/b3dcdb87f930dbbc9dbacb53ad60996e0111e7d8

If you still want to use flipper you can add this to your post_install

  post_install do |installer|
    installer.pods_project.targets.each do |target|
      if target.name == 'Flipper'
        file_path = 'Pods/Flipper/xplat/Flipper/FlipperTransportTypes.h'
        contents = File.read(file_path)
        unless contents.include?('#include <functional>')
          File.open(file_path, 'w') do |file|
            file.puts('#include <functional>')
            file.puts(contents)
          end
        end
      end
    end
  end

The most recent RN Podfiles use the environment variable NO_FLIPPER.

I did export NO_FLIPPER=1 and then pod install (in the ios folder), which uninstalled all the flipper stuff, and after that the app builds. I don’t use flipper anyway, so better this way.

I think it`s because flipper. If you are using flipper, i dont know what to do but if not, delete :flipper_configuration => flipper_config, in your xcode podfile

same

Exact same here. An here my solution: Open Podfile in iOS Folder, disable the line: #:flipper_configuration => flipper_config,

It should look like:

`use_react_native!( :path => config[:reactNativePath], # 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}/…”

)`

run pod install This removes Flipper: Removing CocoaAsyncSocket Removing Flipper Removing Flipper-Boost-iOSX Removing Flipper-DoubleConversion Removing Flipper-Fmt Removing Flipper-Folly Removing Flipper-Glog Removing Flipper-PeerTalk Removing FlipperKit Removing OpenSSL-Universal

Works with my new Test and existing Project

Hi everyone! Thanks for reporting the issue. As of 0.73, Flipper is deprecated and it has been removed in 0.74.

The fix for flipper has been shipped in Flipper 0.248.0, as mentioned here, but Flipper has not been released to Cocoapods since version 0.233.0.

Screenshot 2024-03-06 at 12 42 14

The workaround, for the time being, is to disable Flipper.

We are working toward bringing in the fix highlighted here to 0.73.5 and we will backport the fix at least to the React Native versions in the supported window.

I face a new problem: Permission denied

@JinYuSha0 This also happened to me. I fixed it by deleting my Pods folder and trying again.

in your Podfile you need to replace post_install with this (adding File.chmod(0755, file_path) right before the File.open line:

post_install do |installer|
    installer.pods_project.targets.each do |target|
      if target.name == 'Flipper'
        file_path = 'Pods/Flipper/xplat/Flipper/FlipperTransportTypes.h'
        contents = File.read(file_path)
        unless contents.include?('#include <functional>')
          File.chmod(0755, file_path)
          File.open(file_path, 'w') do |file|
            file.puts('#include <functional>')
            file.puts(contents)
          end
        end
      end
    end
  end

ENV XCode: 15.4 / Simulator: iOS 17.4 RN: 0.71.14 Same issue… please fix it…

If you still want to use flipper you can add this to your post_install

  post_install do |installer|
    installer.pods_project.targets.each do |target|
      if target.name == 'Flipper'
        file_path = 'Pods/Flipper/xplat/Flipper/FlipperTransportTypes.h'
        contents = File.read(file_path)
        unless contents.include?('#include <functional>')
          File.open(file_path, 'w') do |file|
            file.puts('#include <functional>')
            file.puts(contents)
          end
        end
      end
    end
  end

beautiful job !!!

I face a new problem: Permission denied

I use code from this. It has File.chmod(0755, file_path) to bypass permission denied

Great official job for merged !!!

If you still want to use flipper you can add this to your post_install

  post_install do |installer|
    installer.pods_project.targets.each do |target|
      if target.name == 'Flipper'
        file_path = 'Pods/Flipper/xplat/Flipper/FlipperTransportTypes.h'
        contents = File.read(file_path)
        unless contents.include?('#include <functional>')
          File.open(file_path, 'w') do |file|
            file.puts('#include <functional>')
            file.puts(contents)
          end
        end
      end
    end
  end

if someone wants to combine two post installs 🥳

  post_install do |installer|
    installer.pods_project.targets.each do |target|
      if target.name == 'Flipper'
        file_path = 'Pods/Flipper/xplat/Flipper/FlipperTransportTypes.h'
        contents = File.read(file_path)
        unless contents.include?('#include <functional>')
          File.open(file_path, 'w') do |file|
            file.puts('#include <functional>')
            file.puts(contents)
          end
        end
      end
    end
    
    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)
  end

If you still want to use flipper you can add this to your post_install

  post_install do |installer|
    installer.pods_project.targets.each do |target|
      if target.name == 'Flipper'
        file_path = 'Pods/Flipper/xplat/Flipper/FlipperTransportTypes.h'
        contents = File.read(file_path)
        unless contents.include?('#include <functional>')
          File.open(file_path, 'w') do |file|
            file.puts('#include <functional>')
            file.puts(contents)
          end
        end
      end
    end
  end

Wowwww u save my time 👍

Could someone please explain why the React Native team seems so unprofessional and unqualified? This is the third time in the past year that our app has stopped working without any updates from our side. Why is testing so inadequate in the Meta team? Why has our app failed multiple times because some junior developer updated a package in the meta team and our app stopped working? Why is this product of such poor quality?

I am truly exhausted from having to constantly Google and struggle every time our app randomly stops.

@cipolleschi When will your team stop breaking our application?

I hope Devin replaces you soon.

Could someone please explain why the React Native team seems so unprofessional and unqualified? This is the third time in the past year that our app has stopped working without any updates from our side. Why is testing so inadequate in the Meta team? Why has our app failed multiple times because some junior developer updated a package in the meta team and our app stopped working? Why is this product of such poor quality?

I am truly exhausted from having to constantly Google and struggle every time our app randomly stops.

@cipolleschi When will your team stop breaking our application?

closing since fix has been confirmed

Upgrading to v0.73.6 fixed the issue for me 👍🏽

Fixed in react-native v0.73.6

Facing same issue ENV XCode: 15.4 / Simulator: iOS 17.4 RN: 0.71.3

If you still want to use flipper you can add this to your post_install

  post_install do |installer|
    installer.pods_project.targets.each do |target|
      if target.name == 'Flipper'
        file_path = 'Pods/Flipper/xplat/Flipper/FlipperTransportTypes.h'
        contents = File.read(file_path)
        unless contents.include?('#include <functional>')
          File.open(file_path, 'w') do |file|
            file.puts('#include <functional>')
            file.puts(contents)
          end
        end
      end
    end
  end

beautiful job !!!

I face a new problem: Permission denied

I use code from this. It has File.chmod(0755, file_path) to bypass permission denied

If you still want to use flipper you can add this to your post_install

  post_install do |installer|
    installer.pods_project.targets.each do |target|
      if target.name == 'Flipper'
        file_path = 'Pods/Flipper/xplat/Flipper/FlipperTransportTypes.h'
        contents = File.read(file_path)
        unless contents.include?('#include <functional>')
          File.open(file_path, 'w') do |file|
            file.puts('#include <functional>')
            file.puts(contents)
          end
        end
      end
    end
  end

beautiful job !!!

I face a new problem: Permission denied

If Flipper is being deprecated, what is the best choice for debugging going forward?

FYI: I think the React Native team is working on fixing/patching this back to 0.71 and newer versions: 0.71.0: https://github.com/facebook/react-native/pull/43345 0.72.0: https://github.com/facebook/react-native/pull/43344 0.73.0: https://github.com/facebook/react-native/pull/43341

If you still want to use flipper you can add this to your post_install

  post_install do |installer|
    installer.pods_project.targets.each do |target|
      if target.name == 'Flipper'
        file_path = 'Pods/Flipper/xplat/Flipper/FlipperTransportTypes.h'
        contents = File.read(file_path)
        unless contents.include?('#include <functional>')
          File.open(file_path, 'w') do |file|
            file.puts('#include <functional>')
            file.puts(contents)
          end
        end
      end
    end
  end

beautiful job !!!

I face a new problem: Permission denied

This piece of code is to be pasted in your application Podfile, no permission needed there.

After updating to xcode 15, the Flipper which is commonly used for JS debugging, is not compatible for now with xcode 15 version. While we wait for their updates below is a quick fix:

If you are not using Flipper in your application then you can disable below line :flipper_configuration => flipper_config, in your xcode podfile and then in command line run npx pod install.

Hope, it will work.

The solution is in react-native version 0.72.12. Upgrading to this version solved my eas build problem.

i do not think v0.73.6 solves this

node_modules/react-native-worklets-core/cpp/WKTJsiWorklet.h:306:24 No matching function for call to 'all_of'

image

Worklets core is 3rd party dependency. Go to their github and create issue

If you still want to use flipper you can add this to your post_install

  post_install do |installer|
    installer.pods_project.targets.each do |target|
      if target.name == 'Flipper'
        file_path = 'Pods/Flipper/xplat/Flipper/FlipperTransportTypes.h'
        contents = File.read(file_path)
        unless contents.include?('#include <functional>')
          File.open(file_path, 'w') do |file|
            file.puts('#include <functional>')
            file.puts(contents)
          end
        end
      end
    end
  end

You can use this config plugin to patch your Expo app.

// withFlipperMod.js
const { resolve } = require('path');
const { readFileSync, writeFileSync } = require('fs');
const { withDangerousMod, withPlugins } = require('expo/config-plugins');
const { mergeContents } = require('@expo/config-plugins/build/utils/generateCode');

function withFlipperMod(c) {
  return withDangerousMod(c, [
    'ios',
    async (config) => {
      const file = resolve(config.modRequest.platformProjectRoot, 'Podfile');
      const contents = readFileSync(file, { encoding: 'utf-8' });
      writeFileSync(file, patchFlipperTransportTypes(contents));
      return config;
    },
  ]);
}

function patchFlipperTransportTypes(src) {
  return mergeContents({
    tag: `patch-flipper-transport-types`,
    src,
    newSrc: `
    installer.pods_project.targets.each do |target|
    if target.name == 'Flipper'
      file_path = 'Pods/Flipper/xplat/Flipper/FlipperTransportTypes.h'
      contents = File.read(file_path)
      unless contents.include?('#include <functional>')
        File.open(file_path, 'w') do |file|
          file.puts('#include <functional>')
          file.puts(contents)
        end
      end
    end
  end
`,
    anchor: /post_install/,
    offset: 1,
    comment: '#',
  }).contents;
}

module.exports = (config) => withPlugins(config, [withFlipperMod]);

Facing same issue ENV XCode: 15.4 / Simulator: iOS 17.4 RN: 0.73.2

Fixed on M1 machine by next steps:

  1. edit/add react-native.config.js in the root folder of your project: dependencies: { …(process.env.NO_FLIPPER ? {‘react-native-flipper’: {platforms: {ios: null}}} : {}), },

  2. run: NO_FLIPPER=1 arch -x86_64 pod install

The following link may be helpful https://retyui.medium.com/speed-up-ios-builds-by-turning-off-flipper-on-ci-complete-react-native-guide-6846d8433d86

#include <functional> Add this line on flipperTransportType file

Uploading Screenshot 2024-03-19 at 9.57.55 PM.png…

I was able to find temp fix with adding #include <functional> to ios/Pods/Flipper/xplat/Flipper/FlipperTransportTypes.h may be an flipper needs an upgrade

Edit: can confirm flipper repo has this patch facebook/flipper@b3dcdb8

I appreciate your response; it seems to work for me.

What about the other two times? Was it because they had configured to pull the latest version of their library for React Native in the Gradle config?💩💩💩

This is what I encountered when I attempted to update to the new version: 🤦🤦🤦

Incompatible function pointer types passing 'YGSize (YGNodeRef, float, YGMeasureMode, float, YGMeasureMode)' (aka 'struct YGSize (struct YGNode *, float, enum YGMeasureMode, float, enum YGMeasureMode)') to parameter of type 'YGMeasureFunc' (aka 'struct YGSize (*)(const struct YGNode *, float, enum YGMeasureMode, float, enum YGMeasureMode)')

This is the third time in the past year that our app has stopped working without any updates from our side

You are in this issue because you update Xcode to 15.3. It breaks other repositories too

https://github.com/react-native-datetimepicker/datetimepicker/issues/866 https://github.com/margelo/react-native-worklets-core/issues/144

i do not think v0.73.6 solves this

node_modules/react-native-worklets-core/cpp/WKTJsiWorklet.h:306:24 No matching function for call to 'all_of'

image

I face a new problem: Permission denied

@JinYuSha0 This also happened to me. I fixed it by deleting my Pods folder and trying again.

in your Podfile you need to replace post_install with this (adding File.chmod(0755, file_path) right before the File.open line:

post_install do |installer|
    installer.pods_project.targets.each do |target|
      if target.name == 'Flipper'
        file_path = 'Pods/Flipper/xplat/Flipper/FlipperTransportTypes.h'
        contents = File.read(file_path)
        unless contents.include?('#include <functional>')
          File.chmod(0755, file_path)
          File.open(file_path, 'w') do |file|
            file.puts('#include <functional>')
            file.puts(contents)
          end
        end
      end
    end
  end

@JBidar i am also face #35231, I had to disabled flipper, but thank you anyway

Hi All! I’ve tried several fixes for the Flipper issue and I found out that opting out of flipper, or keeping it with the post_install script, fixes the flipper issue, however, in my case, I’m getting an error after flipper is removed (or conditionally added)

Screenshot 2024-03-07 at 12 53 02 PM
node_modules/react-native-worklets-core/cpp/WKTJsiWorklet.h:306:24 No matching function for call to 'all_of'
Screenshot 2024-03-07 at 12 45 50 PM

Output of npx react-native info

System:
  OS: macOS 14.3.1
  CPU: (8) arm64 Apple M1
  Memory: 45.14 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 18.12.1
    path: /var/folders/gd/xn2_qxp160541mcjzw83dpn00000gn/T/yarn--1709833757570-0.8471618925687774/node
  Yarn:
    version: 1.22.19
    path: /var/folders/gd/xn2_qxp160541mcjzw83dpn00000gn/T/yarn--1709833757570-0.8471618925687774/yarn
  npm:
    version: 8.19.2
    path: ~/.nvm/versions/node/v18.12.1/bin/npm
  Watchman:
    version: 2023.12.04.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.14.3
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.4
      - iOS 17.4
      - macOS 14.4
      - tvOS 17.4
      - visionOS 1.1
      - watchOS 10.4
  Android SDK: Not Found
IDEs:
  Android Studio: 2023.2 AI-232.10227.8.2321.11479570
  Xcode:
    version: 15.3/15E204a
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.10
    path: /usr/bin/javac
  Ruby:
    version: 2.7.4
    path: /Users/yofret/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.72.6
    wanted: 0.72.6
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

is anyone else facing the same issue after fixing flipper?

Hi everyone! Thanks for reporting the issue. As of 0.73, Flipper is deprecated and it has been removed in 0.74.

The fix for flipper has been shipped in Flipper 0.248.0, as mentioned here, but Flipper has not been released to Cocoapods since version 0.233.0.

Screenshot 2024-03-06 at 12 42 14 **The workaround, for the time being, is to disable Flipper.**

We are working toward bringing in the fix highlighted here to 0.73.5 and we will backport the fix at least to the React Native versions in the supported window.

Flipper is disabled. But it still doesn’t work

rn 0.73.5 macos 14 xcode 15

Command line invocation: /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace YzPmsAppProject.xcworkspace -configuration Debug -scheme YzPmsAppProject -destination id=5D7B81A6-2924-4A8F-B154-B81DCA55CDA3

User defaults from command line: IDEPackageSupportUseBuiltinSCM = YES

Prepare packages

ComputeTargetDependencyGraph note: Building targets in dependency order note: Target dependency graph (63 targets) Target ‘YzPmsAppProject’ in project ‘YzPmsAppProject’ ➜ Implicit dependency on target ‘Pods-YzPmsAppProject’ in project ‘Pods’ via file ‘libPods-YzPmsAppProject.a’ in build phase ‘Link Binary’ ➜ Implicit dependency on target ‘DoubleConversion’ in project ‘Pods’ via options ‘-lDoubleConversion’ in build setting ‘OTHER_LDFLAGS’ ➜ Implicit dependency on target ‘RCT-Folly’ in project ‘Pods’ via options ‘-lRCT-Folly’ in build setting ‘OTHER_LDFLAGS’ ➜ Implicit dependency on target ‘RCTTypeSafety’ in project ‘Pods’ via options ‘-lRCTTypeSafety’ in build setting ‘OTHER_LDFLAGS’ ➜ Implicit dependency on target ‘RNCAsyncStorage’ in project ‘Pods’ via options ‘-lRNCAsyncStorage’ in build setting ‘OTHER_LDFLAGS’ ➜ Implicit dependency on target ‘RNDateTimePicker’ in project ‘Pods’ via options ‘-lRNDateTimePicker’ in build setting ‘OTHER_LDFLAGS’ ➜ Implicit dependency on target ‘RNGestureHandler’ in project ‘Pods’ via options ‘-lRNGestureHandler’ in build setting ‘OTHER_LDFLAGS’ ➜ Implicit dependency on target ‘RNSVG’ in project ‘Pods’ via options ‘-lRNSVG’ in build setting ‘OTHER_LDFLAGS’ ➜ Implicit dependency on target ‘RNScreens’ in project ‘Pods’ via options ‘-lRNScreens’ in build setting ‘OTHER_LDFLAGS’ ➜ Implicit dependency on target ‘RNVectorIcons’ in project ‘Pods’ via options ‘-lRNVectorIcons’ in build setting ‘OTHER_LDFLAGS’ ➜ Implicit dependency on target ‘React-Codegen’ in project ‘Pods’ via options ‘-lReact-Codegen’ in build setting ‘OTHER_LDFLAGS’ ➜ Implicit dependency on target ‘React-Core’ in project ‘Pods’ via options ‘-lReact-Core’ in build setting ‘OTHER_LDFLAGS’ ➜ Implicit dependency on target ‘React-CoreModules’ in project ‘Pods’ via options ‘-lReact-CoreModules’ in build setting ‘OTHER_LDFLAGS’